What will be the height of a balanced full binary tree with 8 leaves?

Category: QuestionsWhat will be the height of a balanced full binary tree with 8 leaves?
Editor">Editor Staff asked 4 weeks ago

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 Answers
Editor">Editor Staff answered 4 weeks ago

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.