Multiple choice

If the keys '1, 2, 3, 4 and 5' are inserted in order into initially empty a AVL tree, the height of the tree is

  1. 2

  2. 3

  3. 1

  4. 4

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

After inserting 1, 2, 3, 4, 5, the tree structure is: 2 is root, 1 is left child, 4 is right child, 3 is left child of 4, 5 is right child of 4. The height is 2 (root at 0, children at 1, grandchildren at 2).