+1 vote
in Data Structures & Algorithms I by (110k points)
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 Answer

+1 vote
by (672k points)
selected by
 
Best answer
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).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...