AVL trees provide better insertion the 2-3 trees.

Category: QuestionsAVL trees provide better insertion the 2-3 trees.
Editor">Editor Staff asked 5 months ago

AVL trees provide better insertion the 2-3 trees.
 
(a) True
 
(b) False
 
Question is from B-Trees in division B-Trees of Data Structures & Algorithms I
 
The question was posed to me in a job interview.

1 Answers
Editor">Editor Staff answered 5 months ago

Correct answer is (b) False
 
Easiest explanation – Insertion in AVL tree and 2-3 tree requires searching for proper position for insertion and transformations for balancing the tree. In both, the trees searching takes O(log n) time, but rebalancing in AVL tree takes O(log n), while the 2-3 tree takes O(1). So, 2-3 tree provides better insertions.


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: 40701