Topological Sort - All Paths From Source to Target (DAG)
Consider two approaches to find all paths from source to target in a DAG: (1) DFS with memoization caching subpath results, and (2) iterative DFS with explicit stack and path tracking. When is approach (1) preferable over (2)?
