0PricingLogin
Competitive Programming Academy · Lesson

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

  1. Adjacency Lists from Input
  2. BFS for Shortest Unweighted Paths
  3. DFS, Recursion & Iterative Stacks
  4. Connected Components & Flood Fill
← Back to Competitive Programming Academy