Pattern Recognition Drill
Easy Trees
The Problem
Return the inorder traversal of a binary tree as a list.
What approach would you use?
Think about it before scrolling down.
Recurse left, append current, recurse right. O(n) time.
Iterative with explicit stack: push lefts, pop and visit, go right. Same O(n).
Common Trap
Know all three traversals (in/pre/post) and when each is useful. Inorder = sorted for BSTs.