程昱同学
程昱同学
全部文章
分类
归档
标签
去牛客网
登录
/
注册
程昱同学的博客
全部文章
(共127篇)
题解 | #寻找第K大#
class Solution { public: vector<int> num; int res; void find(int l, int r, int k) { int pivot = num[l]; int rr = r; ...
2023-02-12
0
259
题解 | #最小的K个数#
#include <queue> #include <vector> class Solution { public: priority_queue<int> q; vector<int> ans; vector<int...
2023-02-12
0
231
题解 | #滑动窗口的最大值#
#include <vector> class Solution { public: vector<int> ans; queue<int> q; vector<int> myMax; int idx; vect...
2023-02-12
0
282
题解 | #有效括号序列#
#include <stack> class Solution { public: /** * * @param s string字符串 * @return(756076230) bool布尔型 */ map<char,c...
2023-02-12
0
281
题解 | #包含min函数的栈#
class Solution { public: void push(int value) { if(myMin.empty()){ myMin.push(value); } if(myMin.top()>valu...
2023-02-12
0
247
题解 | #用两个栈实现队列#
class Solution { public: void push(int node) { stack1.push(node); } int pop() { if(!stack2.empty()){ int valu...
2023-02-12
0
222
题解 | #输出二叉树的右视图#
#include <iterator> #include <vector> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 求二叉树的右视图 * ...
2023-02-12
0
262
题解 | #重建二叉树#
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * }; */ #include <vector>...
2023-02-12
0
240
题解 | #在二叉树中找到两个节点的最近公共祖先#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
2023-02-12
0
231
题解 | #二叉树的最大深度#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
2023-02-11
0
239
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页