Professional Documents
Culture Documents
Lecs 13
Lecs 13
44 4
2 17 3 78
1 32 2 50 1 88
1 48 1 62
Justification: The easiest way to approach this problem is to find n(h): the minimum
number of nodes in an AVL tree of height h.
• n(1) = 1 and n(2) = 2
• For h ≥ 3, an AVL tree of height h contains the root node, one AVL subtree of
height h – 1 and the other AVL subtree of height h – 1 or h – 2.
• That is, n(h) = 1 + n(h – 1) + n(h – 2)
Height of an AVL Tree
• Knowing n(h – 1) ≥ n(h – 2)
• n(h) = 1 + n(h – 1) + n(h – 2) > 2n(h – 2)
n(h) > 2n(h – 2)
> 4n(h – 4)
> 8n(h – 6)
“thinning out.” 2 6 9 11 14 16 18 22 24 26 29 35 37 39 42 47
• Number of nodes in
the AVL tree is at 1 3 5 8 13 21 34