+1 vote
in Data Structures & Algorithms I by (110k points)
What will be the height of a balanced full binary tree with 8 leaves?

(a) 8

(b) 5

(c) 6

(d) 4

My question comes from Binary Trees topic in division Binary Trees of Data Structures & Algorithms I

I had been asked this question during an online exam.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct choice is (d) 4

Easiest explanation - A balanced full binary tree with l leaves has height h, where h = log2l + 1.

So, the height of a balanced full binary tree with 8 leaves =  log28 + 1 = 3 + 1 = 4.

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

...