题目描述 输入一棵二叉树,判断该二叉树是否是平衡二叉树。 package new_offer; /** * 输入一棵二叉树,判断该二叉树是否是平衡二叉树。 * @author Sonya *思路: *1、借鉴上题 求树的深度。但是效率不高 需要重复遍历结点多次。 *2、后续遍历,记录每个depth ...
分类:
其他好文 时间:
2019-07-12 14:17:54
阅读次数:
113
原题链接在这里:https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/ 题目: Given a binary tree rooted at root, the depth of each node is t ...
分类:
其他好文 时间:
2019-07-08 13:58:55
阅读次数:
127
linux下使用 du查看某个文件或目录占用磁盘空间的大小 du -ah --max-depth=1 去年用过一次 后来忘记了.. 命令这个东西 熟能生巧.. https://www.cnblogs.com/kobe8/p/3825461.html du -ah --max-depth=1 这个是我 ...
分类:
系统相关 时间:
2019-07-07 09:33:20
阅读次数:
133
非递归就是在层次遍历的基础上加上个depth,len变量来记录即可,有点类似于BFS 用c++实现如下: ...
分类:
其他好文 时间:
2019-06-29 22:03:44
阅读次数:
132
题目链接 : https://leetcode cn.com/problems/minimum depth of binary tree/ 题目描述: 给定一个二叉树,找出其最小深度。 最小深度是从根节点到最近叶子节点的最短路径上的节点数量。 说明: 叶子节点是指没有子节点的节点。 示例: 给定二叉 ...
分类:
其他好文 时间:
2019-06-29 19:05:33
阅读次数:
88
原题链接在这里:https://leetcode.com/problems/add-one-row-to-tree/ 题目: Given the root of a binary tree, then value v and depth d, you need to add a row of nod ...
分类:
其他好文 时间:
2019-06-28 09:12:41
阅读次数:
111
3.The significance of Books 书本的意义 (1)A bookless life is an imcomplete life.Books influence the depth and breadth of life.They meet the natural desire ...
分类:
其他好文 时间:
2019-06-25 22:12:05
阅读次数:
158
在学习汉娜塔的时候,遇到一个error RecursionError: maximum recursion depth exceeded in comparison 经过百度,百度的方法: 加上: import sys sys.setrecursionlimit(100000) 可是我加上之后结果如 ...
分类:
编程语言 时间:
2019-06-23 17:27:06
阅读次数:
962
相机属性 1.相机的Clear属性:Skybo背景会渲染天空盒;solid color背景为颜色;depth only仅仅深度,相当于优先级;Don`t Clear背景是上一帧的图像;2.Projection投影方式:Perspective透视模式,这里相机看到的和人眼类似,是一个由角度的视野范围, ...
分类:
编程语言 时间:
2019-06-15 15:17:21
阅读次数:
155
题目描述: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the fart ...
分类:
其他好文 时间:
2019-06-14 00:46:20
阅读次数:
101