1Recursive DFS is cleaner; iterative DFS with an explicit stack is needed when recursion depth exceeds limits.
2For cycle detection in directed graphs, use three states: unvisited (0), in-stack (1), done (2).
3Postorder DFS (process node after children) is useful for bottom-up computations like tree height or subtree sums.
4For flood fill / connected components, DFS with in-place modification (mark visited by changing the value) saves space.