DFS (Connectivity) pattern
Visited state prevents repeated work and lets the traversal distinguish new paths from edges returning to earlier nodes.
Difficulty: Easy · Approach: Visible frontier and visited order
This is a public lesson preview. Sign in with a Lifetime Pass to open the protected animation, solution, and code.