GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 21(b)

Minimum AVL height eight

Data Structures · Binary Search & Balanced Trees · Full GATE CSE 1998 paper

GATE 1998, Q21(b) Descriptive
Report issue

Binary Search & Balanced Trees

Question 21(b), GATE 1998: Find the smallest AVL tree size for height 8.
Question 21(b), GATE 1998: Find the smallest AVL tree size for height 8.
Tap to enlarge
Answer & solution

Answer: 88 nodes for edge height; 54 for level height. (no official key was published)

Using the edge-height convention from part (a), start N(−1)=0,N(0)=1 and apply N(h)=1+N(h−1)+N(h−2). The values at heights 1 through 8 are 2,4,7,12,20,33,54,88. Thus the smallest tree at edge height 8 has 88 nodes. Equivalently, F11−1=89−1=88.

If the source's unstated height convention counts levels, the same physical tree's level height is one larger. A level-height-8 minimum tree therefore has edge height 7 and 54 nodes. This is not a disagreement in AVL structure, only an indexing ambiguity. Specify the convention rather than asserting both numbers describe the same notion of height. The printed empty '(c)' after this question contains no task text and is not invented as another solution item.

Original paper, page 8