Height balanced binary trees can be denoted by HB(k), where k is the difference between heights of left and right subtrees. For each node, its right subtree is a balanced binary tree.īalanced binary trees are also known as height-balanced binary trees.For each node, its left subtree is a balanced binary tree. The absolute difference of heights of left and right subtrees at any node is less than 1.What is a Balanced Binary Treeīalanced Binary trees are computationally efficient to perform operations on.Ī balanced binary tree will follow the following conditions: Hence the need for balanced binary trees. This is the motivation behind making sure that trees are not skewed. In case of binary trees, if the trees are skewed, they become computationally inefficient to perform operations on.
0 Comments
Leave a Reply. |