Question discussion

Consider the following AVL tree. What will be the resultant AVL tree after insertion of node with value 20?

359883Medium DSSSB TGT Computer Science 0 replies 0 views
0

Consider the following AVL tree. What will be the resultant AVL tree after insertion of node with value 20?

Figure for question 179

  • AOption A
  • BOption B
  • COption C
  • DOption D
Correct answer: A

Explanation

Inserting 20 makes 23 unbalanced (a left-right case). A double rotation makes 20 the root of that subtree with 18 and 23 as its children, as shown in option A.

Discussion 0

Nobody has replied yet. Start the discussion!