Postorder Traversal
Finish both subtrees before writing the node down, so the root comes last.
Tree Traversals: Postorder, root comes last
20 is the deepest node on the far left, so it finishes first.
Cost
- Best
- O(n)
- Average
- O(n)
- Worst
- O(n)
- Space
- O(h)
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.