建立高度平衡的二叉搜索树是为了提高二叉搜索树的效率,减少树的平均搜索长度。
The highly balanced binary search tree is established in order to improve efficiency of the binary search tree and to shorten the average search tree.
对于这个问题,一个高度平衡的二叉树是指每个节点的两个子节点的深度的差异都不超过1的二叉树。
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。基于这个思路递归处理。
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。基于这个思路递归处理。
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.
应用推荐