🦉
AI Tutor
Explore
People
Courses
Pricing
Sign in
Sign up
Binary Tree Level Order Traversal
Trees · BFS · Queues · greeting
Learn mode
00:00
Mute
End interview
select
rect
note
arrow
text
clear
Level-order traversal
left → 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:
—