Binary Tree Level Order Traversal
Trees · BFS · Queues · greeting
Learn modeInterviewLearnLarry’s gold answer — use Show text to read it out loud
00:00End interview
Level-order traversalleft → right, level by level▶3▶7▶9▶15▶20▶Output:[[3], [9, 20], [15, 7]]▶
Owl: Hi. Level-order traversal. Before we write any code, tell me how you would approach this. If I asked you to print a tree one level at a time, what extra structure would you reach for, and why not recursion-only DFS?
You: —