⚡ AlgoZen_
~/home/trees_&_bst/bfs_(level_order)2 / 3

BFS (Level Order)

Intermediate

Breadth-First Search on a tree visits all nodes level by level using a queue. Produces level-order traversal and finds the shortest path.

time:O(n)
space:O(n)
⚡ +200_XP
step[1/11]
> Start
1245367
BFS on a binary tree visits level by level. Start with the root in the queue.

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