Skip to main content
HS
HiSETSuccess
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

BFS vs DFS on a Grid

Same loop, different container: a queue explores in rings (shortest path), a stack dives deep.

O(rows × cols) time and space

Up to 8 rows × 10 columns. . = open, # = wall, S = start, E = end.

Presets
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