🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Binary Search Tree Operations: all 15 questions

Quiz: Binary Search Tree Operations · Question 5 of 15

Why does the inorder successor of a node with two children never have a left child?

Why does the inorder successor of a node with two children never have a left child?

  1. A.It is found by going left as far as possible, so a left child would be even smaller and would have been chosen
  2. B.Because successors are always leaves
  3. C.Because the right subtree has no left children
  4. D.It can have a left child; that case needs special code
Answer & explanation

Correct answer: It is found by going left as far as possible, so a left child would be even smaller and would have been chosen

That is why deleting the successor afterwards is always the easy case: a leaf or one right child.

Can you get the rest right without peeking?

Take the timed Quiz: Binary Search Tree Operations quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →