Graphs medium time O(V + E) space O(V)
Depth-First Search
DFS commits to a path and follows it until it dead-ends, then backtracks to the last node with an unexplored neighbour. The call stack records the path you are currently standing on.
DFS from A: go as deep as possible, then back up.
1 / 33
A fixed scene — scrub through it, or open the code.
Practice
Machine twin: /dsa-viz-v2/graph-dfs.json — the full deterministic run as structured data.