GATE Computer ScienceHardGATE CS (PYQ pattern)

In an AVL tree a single node has height 0. What is the minimum number of nodes in an AVL tree of height 6?

  1. A. 32
  2. B. 33
  3. C. 54
  4. D. 40

Correct answer: B. 33

The minimal AVL tree of height h has a minimal subtree of height h−1 and one of height h−2 under the root: N(h) = N(h−1) + N(h−2) + 1 with N(0) = 1, N(1) = 2. This gives 4, 7, 12, 20, 33 for h = 2 to 6.

More Programming and Data Structures (GATE) questions

Exams that ask this topic