LeetCode p110 Balanced Binary Tree 题解
1.题目:
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.
2.解题思路:
dp
3.代码
1 |
|