Module 8 · Graphs and Trees · Binary Tree

Level order traversal

A queue visits the tree level by level. When a level starts, the queue holds exactly that level: poll that many nodes, and the children they add wait for the next level.