32,690 views
39 39 votes

The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height $h$ is:

  1. $2^h -1$

  2. $2^{h-1} -1$

  3. $2^{h+1} -1$

  4. $2^{h+1}$

7 Answers

Best answer
60 60 votes
$2^{h+1} - 1$ just try this taking a small complete binary

never try to remember these formulae as remembering formulae is an overhead try to take examples in such cases.

Correct Answer: $C$
edited by
14 14 votes

At maximum tree is given as above

So maximum height = 2 (15 - > 10 -> 8) or other all are same height

Put h = 2 in option and find number of nodes

A- 22 -1 = 3  wrong 

B- 21-1 = 1 wrong 

C- 23-1 = 7 correct

D- 23 = 8 wrong 

SO option C is correct option

4 4 votes

height H=0 ( only root node ) , no of node N=1=20

H=1 , N=21

... so on 

total =20 +21+22+.......2H =2H+1-1

Ans is C

3 3 votes

=2$^0$+2$^1$+2$^2$+...+2$^h$ this a  gp

=2$^h$$^+$$^1$-1

0 0 votes
We are required to find the maximum number of nodes. Maximum number of nodes will occur in the case of a Perfect tree. We just need to calculate relation between the height of Perfect tree and its number of nodes.

Height zero :  one node - > 2^0

Height one : two node -> 2^1

Height two : four nodes -> 2^2

.....

Height h : 2^(h) nodes

 

Now if you some all the nodes at various heights , you will get the total number of nodes.

 

 N = 2^0 + 2^1 + 2^2 + 2^3 ...... + 2^h

(Sum of a Geometric Progression = first term * (1-ratio^number of terms)/(1-ratio))

=>  N =  2^(h+1) - 1

 

 

 

 
0 0 votes
We are required to find the maximum number of nodes. Maximum number of nodes will occur in the case of a Perfect tree. We just need to calculate relation between the height of Perfect tree and its number of nodes.

Height zero :  one node - > 2^0

Height one : two node -> 2^1

Height two : four nodes -> 2^2

.....

Height h : 2^(h) nodes

 

Now if you some all the nodes at various heights , you will get the total number of nodes.

 

 N = 2^0 + 2^1 + 2^2 + 2^3 ...... + 2^h

(Sum of a Geometric Progression = first term * (1-ratio^number of terms)/(1-ratio))

=>  N =  2^(h+1) - 1

 

 

 

 
Answer:
Position:
Show:

Related questions

36 36 votes
4 answers 4 answers
13.8k
13.8k views
Kathleen asked Sep 21, 2014
13,840 views
Consider the following C program segment where $\text{CellNode}$ represents a node in a binary tree:struct CellNode { struct CellNode *leftChild; int element; struct Cell...
22 22 votes
3 answers 3 answers
11.2k
11.2k views
Kathleen asked Sep 21, 2014
11,169 views
The inorder and preorder traversal of a binary tree are$\text{d b e a f c g}$ and $\text{a b d e c f g}$, respectivelyThe postorder traversal of the binary tree is:$\text...
36 36 votes
4 answers 4 answers
40.7k
40.7k views
Kathleen asked Sep 21, 2014
40,656 views
The maximum number of binary trees that can be formed with three unlabeled nodes is:$1$$5$$4$$3$
37 37 votes
3 answers 3 answers
21.8k
21.8k views
Kathleen asked Sep 21, 2014
21,771 views
Consider a hash table of size seven, with starting index zero, and a hash function $(3x + 4)\mod 7$. Assuming the hash table is initially empty, which of the following is...