See BFS & DFS
actually run.
Two interactive hubs for every graph and grid traversal pattern — live animations, call-stack dry-runs, and full LeetCode-style code (driver + helper) with click-to-reveal comments. Built around how you actually learn.
Not flashcards. A pattern playground.
Every pattern pairs the intuition, the bugs you actually hit, and runnable code — so the idea sticks instead of the syntax.
Full LeetCode-style code
Each snippet is a complete class Solution — the driver method and its helper, with authentic LC/GFG signatures you can paste and submit.
Click-to-reveal comments
Read the code clean first. A ● marks lines that hide a note — click to reveal the “why”, click again to hide. Quiz yourself line by line.
Live animations & 3D
Watch the queue fill, the recursion stack grow, the grid flood — synced to the code line lighting up as it executes. Real graphs render in 3D.
Pick a traversal. Dive in.
Separate, focused hubs — BFS for levels, distances and shortest paths; DFS for recursion, components, cycles and backtracking.
Queue · levels · distance
Graph BFS, islands, multi-source BFS, level BFS, boundary BFS, shortest path, 0-1 BFS, state-space BFS, bipartite, and Kahn topo sort.
Call stack · cycles · paths
Recursive & iterative DFS, flood fill, island area, boundary DFS, undirected & directed cycle detection, bipartite coloring, topo sort, backtracking.
Three passes per pattern.
Get the intuition
Read “when to use”, the key insight, and a plain-language analogy — plus the bugs you’ll actually hit.
Watch it run
Step through the animation while the matching code line highlights, so the mechanism — not the syntax — lands.
Own the code
Read the full driver + helper clean, then click lines to reveal comments and test whether you really know why each step is there.
Start with the DFS hub.
14 patterns, full solutions, click-to-reveal comments and call-stack dry-runs — all in one page.
Launch the DFS hub →