牛客err
牛客err
全部文章
分类
题解(4)
归档
标签
去牛客网
登录
/
注册
牛客err的博客
TA的专栏
20篇文章
0人订阅
数据结构练习
20篇文章
132人学习
全部文章
(共162篇)
题解 | #合并二叉树#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullpt...
2024-08-22
1
96
题解 | #二叉搜索树与双向链表#
class Solution { public: TreeNode* Convert(TreeNode* pRootOfTree) { // 如果树为空,则直接返回nullptr if (pRootOfTree == nullptr) { ...
2024-08-22
1
166
题解 | #二叉树的最大深度#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-08-22
1
104
题解 | #二叉树的后序遍历#
来自专栏
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-08-22
1
107
题解 | #二叉树的中序遍历#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-08-22
1
87
题解 | #二叉树的前序遍历#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullpt...
2024-08-21
1
94
题解 | #比较版本号#
来自专栏
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 比较版本号 # @param version1 string字符串 # @param version2 string字符串 # @return int整型 # class Solution: def c...
2024-08-20
1
126
题解 | #旋转数组的最小数字#
来自专栏
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector * @return int整型 ...
2024-08-20
1
117
题解 | #数组中的逆序对#
来自专栏
class Solution { public: const int MOD = 1000000007; // 归并排序中的合并函数,同时计算逆序对数量 int merge(vector<int>& nums, int left, int mid, int ...
2024-08-20
1
93
题解 | #寻找峰值#
来自专栏
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector * @return int整型 ...
2024-08-20
1
103
首页
上一页
2
3
4
5
6
7
8
9
10
11
下一页
末页