摘要:
题目:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees ofeverynode never differ by more than 1.解题思路1(下面给出两种代码实现,代码1和代码2):采用递归的方法,对每一层的节点进行遍历,从叶子节点开始回溯,并从下往上判断每一层的各个是否满足平衡树的条件,并得到以该节 阅读全文