Problem. Given the root of a binary tree, return its node values level by level, each level from left to right.
3
/ \ → [[3], [9, 20], [15, 7]]
9 20
/ \
15 7
Depth-first traversals (lesson 10.1) go deep before wide. Level order goes wide before deep, and the tool for that is a queue: nodes are processed in the order they were discovered, so all of depth d comes before any of depth d + 1. It's breadth-first search, which module 11 uses on graphs to find shortest paths.
ML context. Level-by-level processing appears whenever depth means something: statistics per layer of a module tree, per-level summaries of a hierarchical taxonomy (how many labels at each granularity), drawing a tree, and the frontier of a search that should expand the nearest options first. And "the shallowest node with a property" (the first leaf, the closest match) is answered by stopping a level-order scan early (lesson 10.2's minimum depth).