When is the current node the LCA in recursive split logic?
Practice this question from Lowest Common Ancestor - Recursive split Pattern Practice Quiz, with options and an explanation.
Question
When is the current node the LCA in recursive split logic?
Option A — Correct answer
Both left and right recursive calls return non-null
Option B
Both sides return null
Option C
The current node is a leaf
Option D
The values are sorted
Explanation
When the left and right recursive calls both return non-null.