Binary Tree Level Order Traversal
Trees · BFS · Queues · greeting
Learn mode
00:00End interview
Level-order traversalleft → right, level by level3791520Output:[[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: