When should the current node value be added?
Practice this question from Binary Tree Traversals - DFS recursion Pattern Practice Quiz, with options and an explanation.
Question
When should the current node value be added?
Option A — Correct answer
After left recursion and before right recursion
Option B
Before left recursion
Option C
After right recursion only
Option D
Only at leaf nodes
Explanation
Add it after traversing left and before traversing right.