If p is an ancestor of q, what can be returned?

Practice this question from Lowest Common Ancestor - Recursive split Pattern Practice Quiz, with options and an explanation.

Question

If p is an ancestor of q, what can be returned?

Option A — Correct answer

p can be returned as the LCA

Option B

q must always be returned

Option C

The root must always be returned

Option D

No LCA exists

Explanation

p can be returned as the lowest common ancestor.

Lowest Common Ancestor - Recursive split Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker