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.
题意:
给定一个二叉树,判断它是否是平衡二叉树。
平衡二叉树(Balanced Binary Tree)又被称为AVL树(有别于AVL算法),且具有以下性质:它是一 棵空树或它的左右两个子树的高度差的绝对值不超过1,并且左右两个子树都是一棵平衡二叉树。
Balanced Binary Tree
最新推荐文章于 2020-12-18 14:21:59 发布
本文介绍了一种判断二叉树是否为平衡二叉树的方法。平衡二叉树是指对于任意节点,其左右子树高度差不超过1的二叉树。文章详细解释了平衡二叉树的定义,并给出了一种有效的判断算法。
948

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



