468 views
1 votes
1 votes
 

The height h of an AVL tree with n nodes lies in the interval:

1.

log2(n+1) ≤ h < c log2(n+2)+b

 

2.

log10(n) ≤ h < c log10(n+1)+b

 

3.

log10(n+1) ≤ h < c log10(n+2)+b

 

4.

log2(n) ≤ h < c log2(n+1)+b

1 Answer

0 votes
0 votes
ANS 1

the max no of node of given hight h is 2^(h+1)-1 for BT or BST or AVL tree that is equal to the min hight  h of tree for given these many nodes 2^(h+1)-1.

now let take node 2^(h+1)-1=n   where n is no of node in tree

2^(h+1)=n+1

take log both side

h+1=log(n+1) base 2

h=log(n+1) base 2 -1  we get lower bound

Related questions

2 votes
2 votes
1 answer
1
himgta asked Apr 21, 2018
328 views
Find the output of the c program below, assume base address of the array is 1500. The size of int is 4 bytes
0 votes
0 votes
0 answers
2
2 votes
2 votes
2 answers
3
3 votes
3 votes
1 answer
4
tapzo asked Jan 17, 2018
401 views
let L be a set of binary string whose integer equivalent is congruent to 10 (mod 16) Then minimal DFA that accept L contains how many states ? plz explain