An AVL tree is a self – balancing binary search tree, in which the heights of the two child sub trees of any node differ by _________

Category: QuestionsAn AVL tree is a self – balancing binary search tree, in which the heights of the two child sub trees of any node differ by _________
Editor">Editor Staff asked 1 month ago

An AVL tree is a self – balancing binary search tree, in which the heights of the two child sub trees of any node differ by _________
 
(a) At least one
 
(b) At most one
 
(c) Two
 
(d) At most two
 
My question comes from Binary Trees in chapter Binary Trees of Data Structures & Algorithms I
 
The question was posed to me in a national level competition.

1 Answers
Editor">Editor Staff answered 1 month ago

Correct choice is (b) At most one
 
Easiest explanation – In an AVL tree, the difference between heights of the two child sub trees of any node is at most one. If the height differs by more than one, AVL tree performs rotations to balance the tree.