789 views
0 votes
0 votes
What is the maximum possible height of an AVL tree with 20 nodes?

2 Answers

0 votes
0 votes
To find maximum possible height with 20 nodes, we need to find minimum no. of nodes of a  given height

H(x) -- for height x

H(0) = nodes of nodes 1

H(1) = 2

H(2) = 1 +H(0) + H(1) = 4

H(3) = 1 + 4+ 2= 7

H(4) = 1 + 7 + 4 = 12

H(5) = 1+12+7 =20

So, maximum possible height for 20 nodes --> 5

Related questions

1 votes
1 votes
1 answer
1
Shankar Jha asked Jun 15, 2018
1,263 views
Binary search can be carried out on a set of ordered data items stored in a(A) Array (B) Stack (C) Queue (D) List
1 votes
1 votes
1 answer
2
Anshul Shankar asked Jul 19, 2016
3,786 views
Adacency list is preferred over adjacency matrix when the graph is?A) planarB) DenseC) CliqueD) none of these