⚡ AlgoZen_
~/home/graphs/breadth-first_search1 / 3

Breadth-First Search

Intermediate

Explore a graph level by level using a queue. Visit all neighbors at the current depth before moving deeper. Guarantees the shortest path in unweighted graphs.

time:O(V + E)
space:O(V)
⚡ +200_XP
step[1/13]
> Start
A
B
C
D
E
F
Start BFS from node A. Add A to the queue.

// tap NEXT STEP to walk through one step at a time