An empty tree has height ________
A tree with just a root and no other nodes has height___
The root is at depth_____
What is the maximum possible height for a tree with 31 nodes?
What is the minimum possible height for a tree with 31 nodes?
First we have to know what is height of a tree ,it is nothing but distance from root node to any node.
Answer:0
empty tree has height 0
Beacuse it does not contain any nodes or elements ,so it has height 0
Answer:0
A tree with just a root and no other nodes has hieght 0
As it has only root node because it has no leaf nodes so it has height 0 as leaf nodes height is
Answer:0
As said previously root is at depth 0
As it doesn't have children, children of root is at depth 1.
Answer:30
Because
Maximum height of tree is
H=N-1
For unbalanced tree
Where H is height
31-1=30
Answer:4
Beacause minimum height of a tree is
log base2(N+1)-1
=5-1
=4
this is the minimum height
Get Answers For Free
Most questions answered within 1 hours.