in DS recategorized by
2,970 views
2 votes
2 votes

In a full binary tree number of nodes is $63$ then the height of the tree is :

  1. $2$
  2. $4$
  3. $3$
  4. $6$
in DS recategorized by
by
3.0k views

1 comment

I think height is 5
0
0

2 Answers

2 votes
2 votes
max number of nodes in Binary tree of hight h is   = 2^(h+1)−1  

put h = 5 then we get 63 node

answer should be 5 only
edited by
1 vote
1 vote

hieght of complete binary tree=$\left \lceil log _{2}n \right \rceil$

=$\left \lceil log _{2}63 \right \rceil$

=$\left \lceil 5.9 \right \rceil$

=6

Alternative

max number of nodes = $2^{(h+1)}-1$  put value $h=6$

= $2^{6}-1$ 

=$63$ number of node given in complete binart tree

1 comment

Putting $h=6$ in $2^{h+1}-1$ will be $2^{6+1}-1 \rightarrow 2^7-1=127$

Your math is wrong.
5
5
Answer:

Related questions