1.

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 IThis question was addressed to me by my school teacher while I was bunking the class.

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).



Discussion

No Comment Found

Related InterviewSolutions