In the delete operation of a BST, we need the inorder successor (or…

PYQ Capgemini Hiring Assessment 2024

In the delete operation of a BST, we need the inorder successor (or predecessor) of a node when the node being deleted has both its left and right children non-empty. Which of the following is true about the inorder successor needed in the delete operation?

  1. A.

    Inorder successor is always a leaf node

  2. B.

    Inorder successor is always either a leaf node or a node with an empty left child

  3. C.

    Inorder successor may be an ancestor of the node

  4. D.

    Inorder successor is always either a leaf node or a node with an empty right child

Attempted by 98 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…