PATHLIGHT
LESSON 03 OF 08Tree BFS · level order
0% learnt
BINARY TREE LEVEL-ORDER TRAVERSAL · BREADTH-FIRST SEARCH

The queue begins with [4]. Which node leaves first?

BFS always processes the oldest queued node. At the start, the root is the only node in the queue.

RULE TO APPLYA FIFO queue preserves increasing depth: dequeue one node, then enqueue its children.
LIVE ALGORITHM STATELevel size = 1, so this level contains only the root.
4root2left child6right child1357
FIFO QUEUE · FRONT LEAVES FIRST
4