LeetCode Prep
Algorithm Visualizer
Step through two pointers, sliding window, binary search, BFS/DFS, heaps, DP, and union-find one operation at a time.
← All visualizers
O(rows × cols) time and spaceBFS vs DFS on a Grid
Same loop, different container: a queue explores in rings (shortest path), a stack dives deep.
S
E
Queue (front → back)0,0
In frontierCurrentVisited (number = order)PathWall
1/55BFS explores in rings: everything 1 step away, then 2 steps, and so on. Start goes in the queue.
Keyboard: ← → step · Space play/pause