The Gateway to Computer Science Excellence
+16 votes
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 by Boss (30.8k points)
edited by | 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.

3 Answers

+33 votes
Best answer

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 by
+9 votes

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)
+3 votes
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 by
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,370 answers
198,506 comments
105,276 users