Level Order Traversal
Walk depth by depth with a queue rather than the call stack.
Tree Traversals: Level order uses a queue
50 is the root, and level order starts at the top.
Cost
- Best
- O(n)
- Average
- O(n)
- Worst
- O(n)
- Space
- O(w)
w is the maximum width.
Before this
Related
Leads to
Topics that need this one first.
Taught by the same lesson
Tree Traversals covers these too, in the same run.