Question discussion

The keys 10, 20, 30, 40, 50, 25 are inserted in this order into an initially empty AVL tree. What is the key at the root after all insertio…

1122Medium DSSSB TGT Computer Science 0 replies 1 views
0

The keys 10, 20, 30, 40, 50, 25 are inserted in this order into an initially empty AVL tree. What is the key at the root after all insertions?

  • A20
  • B25
  • C30
  • D40
Correct answer: C

Explanation

After 10, 20, 30 and 40, 50 the root is 20; inserting 25 unbalances the root (left height 1, right height 3) and a right-left double rotation makes 30 the root.

Discussion 0

Nobody has replied yet. Start the discussion!