Why is direct recursive DFS better than reordering later?
Practice this question from Binary Tree Traversals - DFS recursion Pattern Practice Quiz, with options and an explanation.
Question
Why is direct recursive DFS better than reordering later?
Option A — Correct answer
It produces the correct order in one visit per node
Option B
It sorts the values automatically
Option C
It avoids all recursion space
Option D
It only works for arrays
Explanation
It produces the required traversal order while visiting each node once.