2.3k views

The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a binary tree of height $5$ are

1. $63$ and $6$, respectively
2. $64$ and $5$, respectively
3. $32$ and $6$, respectively
4. $31$ and $5$, respectively
in DS
edited | 2.3k views
+8

max  height of binary tree = 2h+1-1

min height of binary tree =h+1

0
Its not max n min height, instead it is max n min no of nodes of binary tree of height h.

Option A is correct because height $5$ means level $6$ so maximum node $= 2^l -1 =2^6 -1=63$
and for minimum, at each level only single node so total $6$.

by Active (5k points)
edited

LEVEL ARE 5 = 2^0 +  2^1 + 2^2 +2^3 +2^4 +2^5 =1 + 2+ 3 +8 +16 +32  =63 = maximum &

atleast one at each level = 1(root)+1+1+1+1+1 =6  =minimum

by (441 points)
Number of nodes is maximum for a perfect binary tree. A binary tree of height h has 2

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

$2^{5 + 1} - 1 = 2^{6} - 1 = 63$ Number of nodes is minimum for a skewed binary tree. A binary tree of height h has h+1 nodes.

$h + 1 = 5 + 1 = 6$ by Boss (10.8k points)
edited