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 of every node never differ by more than 1.
描述
给出一棵二叉树,判断是否为平衡二叉树
分析
在求二叉树深度的过程中,判断左右子树是否满足
代码
1 | /** |