The Gateway to Computer Science Excellence
0 votes
minimum no of nodes n AVL tree of height 11 is
a)230  b)231  c)232 c)233
in Programming by Boss (49.3k points) | 1.1k views

1 Answer

+3 votes

Ans should be C) 232  (assume root at height 1)

by Boss (17.1k points)
edited by
I think with H=1, we need to have at least 2 node

and with H=0,  N(0)= 1


And rest procedure is correct but your ans is for h=10 , so for h=11

N(11)= 1 + N(10) + N(9)

         = 1 + 232 + 143

         = 376
it will be correct , if i assume root node at hight 0 , but i assume root at height 1 so at height 1 no of node is only 1 which is root only ..( i mentioned in diagram )

as here not given what is height of root ... i assumed according to option ...

so ans 232 is correct :)
If you are assuming according to the options given then its alright but in general definition of Height of a tree says root has zero height.

I think You can assume level of root as 1 or 0.
Well the answer is based on assumption that Height=1 at Root, but usually we follow root at height 0.
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,309 answers
105,026 users