wydxry
wydxry
全部文章
题解
归档
标签
去牛客网
登录
/
注册
wydxry的博客
全部文章
/ 题解
(共86篇)
题解 | #把二叉树打印成多行#
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N...
C++
2022-04-19
0
356
题解 | #数据流中的中位数#
class Solution { public: priority_queue<int> qmin; priority_queue<int, vector<int>, greater<int>> qmax; void Inser...
C++
2022-04-19
0
394
题解 | #正则表达式匹配#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str string字符串 * @param pattern string字...
C++
2022-04-19
0
376
题解 | #二叉树中的最大路径和#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
C++
2022-04-19
0
391
题解 | #最小生成树#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最小的花费代价使得这n户人家连接起来 * @param n int n户人家的村庄 * @pa...
C++
2022-04-19
0
442
题解 | #二叉搜索树的最近公共祖先#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
C++
2022-04-18
0
311
题解 | #【模板】链表#
#include <bits/stdc++.h> using namespace std; struct Node { int v; Node *next; Node(int x): v(x), next(NULL) {} }; int main() { ...
C++
2022-04-18
0
417
题解 | #点击消除#
#include <bits/stdc++.h> using namespace std; int main() { stack<char> st; string s; cin>>s; for (auto& c: s) { ...
C++
2022-04-18
0
381
题解 | #逆波兰表达式求值#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param tokens string字符串vector * @return int整型...
C++
2022-04-18
0
394
题解 | #栈的压入、弹出序列#
class Solution { public: bool IsPopOrder(vector<int> pushV,vector<int> popV) { stack<int> st; int n = pushV.size...
C++
2022-04-18
0
338
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页