4.1 Implement a function to check if a binary tree is balanced. For the purposes of this question, a balanced tree is defined to be a tree such that the heights of the two subtrees of any node never differ by more than one.
LeetCode上的原题,请参见我之前的博客Balanced Binary Tree 平衡二叉树。
本文转自博客园Grandyang的博客,原文链接:平衡二叉树[CareerCup] 4.1 Balanced Binary Tree ,如需转载请自行联系原博主。
本文介绍了一种检查二叉树是否平衡的方法,平衡定义为任意节点的两个子树高度差不超过一。文章提供了LeetCode上关于平衡二叉树问题的解答,并指出了原文链接。
156

被折叠的 条评论
为什么被折叠?



