Why use postorder recursion?

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

Question

Why use postorder recursion?

Option A — Correct answer

The current node needs results from both subtrees

Option B

It sorts paths automatically

Option C

It avoids all stack space

Option D

It only works for arrays

Explanation

The current node must know what was found in both subtrees before deciding.

Lowest Common Ancestor - Recursive split Pattern Practice Quiz

All questions · Previous question

Open on QuizMaker