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 5 months 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 5 months 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.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702