Python & Algorithmic Problem Solving/Array, String & Graph Patterns

Graph Traversal: BFS and DFS

24 min
encouraging · balanced
Built-in tutor

Ready when you are

BFS explores by **distance**, DFS explores by **commitment**. Shortest path on unweighted edges is always BFS; reachability, cycles, and ordering usually want DFS.

Beat 1 of 5