Question discussion

Consider a binary search tree given below.What is the pre-order traversal of binary search tree after node 14 is deleted?

358623Medium DSSSB TGT Computer Science 0 replies 0 views
0
Consider a binary search tree given below.
What is the pre-order traversal of binary search tree after node 14 is deleted?

Figure for question 119

  • A16, 10, 7, 13, 11, 20, 18, 25, 22
  • B7, 10, 11, 13, 16, 18, 20, 22, 25
  • C16, 7, 10, 13, 11, 18, 22, 20, 25
  • D25, 20, 22, 18, 11, 13, 10, 16, 7
Correct answer: A

Explanation

When the root 14 is deleted, it is replaced by its inorder successor 16, which also has the right subtree 20 with children 18 and 25. The pre-order traversal then becomes 16, 10, 7, 13, 11, 20, 18, 25, 22.

Discussion 0

Nobody has replied yet. Start the discussion!