Multiple choice

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

  1. 2

  2. 3

  3. 4

  4. 5

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

Inserting 1, 2, 3, 4, 5 into an AVL tree: 1, then 2 (right), then 3 (causes rotation, 2 becomes root), then 4 (right of 3), then 5 (causes rotation, 4 becomes right child of 3). The root is 2.