牛客马MAXEY
牛客马MAXEY
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客马MAXEY的博客
TA的专栏
68篇文章
1人订阅
2024考研数据结构
68篇文章
306人学习
全部文章
(共66篇)
题解27 | 递归非递归方法#二叉树中找两节点的最近公祖先#
来自专栏
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param root TreeNode类 * @param o1 int整型 ...
2023-09-25
0
164
【2024考研】题解26 | #二叉搜索树的最近公共祖先#
来自专栏
#include <vector> class Solution { public: /** * @param root TreeNode类 * @param p int整型 * @param q int整型 * @return in...
2023-09-25
0
190
【2024考研】题解25 | #判断是不是平衡二叉树#
来自专栏
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2023-09-24
0
238
【2024考研】题解24 | #判断是不是完全二叉树#
来自专栏
#include <queue> class Solution { public: bool isCompleteTree(TreeNode* root) { // write code here special case if (root == ...
2023-09-23
0
176
【2024考研】题解23 | #判断是不是二叉搜索树#
来自专栏
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2023-09-23
0
194
【2024考研】题解22 | #二叉树的镜像#
来自专栏
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2023-09-23
0
171
【2024考研】题解21| #按值加成合并二叉树#
来自专栏
/**傻逼题我还以为一个一个的连呢 * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), ri...
2023-09-23
0
128
【2024考研】题解20 | #对称的二叉树#
来自专栏
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2023-09-23
0
128
【2024考研】题解19 | #按之字形顺序打印二叉树#
来自专栏
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2023-09-23
0
197
【2024考研】题解18 | #二叉树中和为某值的路径I#
来自专栏
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2023-09-23
0
214
首页
上一页
1
2
3
4
5
6
7
下一页
末页