The height of 2-3 tree with n elements is ______

Category: QuestionsThe height of 2-3 tree with n elements is ______
Editor">Editor Staff asked 5 months ago

The height of 2-3 tree with n elements is ______
 
(a) between (n/2) and (n/3)
 
(b) (n/6)
 
(c) between (n) and log2(n + 1)
 
(d) between log3(n + 1) and log2(n + 1)
 
This interesting question is from B-Trees topic in section B-Trees of Data Structures & Algorithms I
 
This question was addressed to me by my school teacher while I was bunking the class.

1 Answers
Editor">Editor Staff answered 5 months ago

The correct answer is (d) between log3(n + 1) and log2(n + 1)
 
To explain: The number of elements in a 2-3 tree with height h is between 2h – 1 and 3h – 1. Therefore, the 2-3 tree with n elements will have the height between log3(n + 1) and log2(n + 1).


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