BFS for Shortest Unweighted Paths
Layer-by-layer distance from a source.
What BFS Does
BFS explores a graph in rings: first your start, then everything one step away, then two steps, and so on. 🌊
Why Rings Mean Shortest
Because BFS finishes each ring before the next, the first time it reaches a node is the shortest unweighted path to it.
All lessons in this course
- Adjacency Lists from Input
- BFS for Shortest Unweighted Paths
- DFS, Recursion & Iterative Stacks
- Connected Components & Flood Fill