![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
树
hh
blue_mmxx
这个作者很懒,什么都没留下…
展开
-
平衡二叉树
平衡二叉树 自下而上 后序遍历加剪枝 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int checkhig原创 2021-03-25 20:14:07 · 48 阅读 · 0 评论 -
二叉树的深度
leetcode二叉树的深度 按照数据结构书上的方式求深度,可以有两种方式 第一种后序方式求高度 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solut原创 2021-03-22 21:27:47 · 60 阅读 · 0 评论 -
二叉树的镜像
请完成一个函数,输入一个二叉树,该函数输出它的镜像。 https://leetcode-cn.com/problems/er-cha-shu-de-jing-xiang-lcof/ 二叉树的镜像 输入:root = [4,2,7,1,3,6,9] 输出:[4,7,2,9,6,3,1] 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/er-cha-shu-de-jing-xiang-lcof 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明原创 2021-03-22 20:50:50 · 66 阅读 · 0 评论