Consider the following tree. If this tree is used for sorting, then a new…

2025

Consider the following tree.

If this tree is used for sorting, then a new number 8 should be placed as the

  1. A.

    left child of the node labeled 30

  2. B.

    right child of the node labeled 5

  3. C.

    right child of the node labeled 30

  4. D.

    left child of the node labeled 10

Attempted by 184 students.

Show answer & explanation

Correct answer: D

Explanation:

If it is to be used for sorting, label of left child should be less than the label of the current node. Coming down the tree, we get left child of node labeled 10 as the correct slot for 8.

Explore the full course: Coding For Placement