DFS, Recursion & Iterative Stacks
Explore deep and avoid recursion limits.
What DFS Does
DFS dives as deep as it can down one path, then backs up and tries the next. Think of exploring a maze hallway by hallway. 🧭
DFS vs BFS
BFS spreads in rings; DFS plunges deep first. Both visit every reachable node, but in a very different order.
All lessons in this course
- Adjacency Lists from Input
- BFS for Shortest Unweighted Paths
- DFS, Recursion & Iterative Stacks
- Connected Components & Flood Fill