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 5 months 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 5 months 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.


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: 40702