

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Trees
incomplete
2: Binary Trees
incomplete
3: Insert Nodes
incomplete
4: Insert Review
incomplete
5: Min and Max
incomplete
6: Delete
incomplete
7: Deletion Review
incomplete
8: Preorder Traversal
incomplete
9: Postorder Traversal
incomplete
10: Inorder Traversal
incomplete
11: Node Exists
incomplete
12: Height
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A "postorder" traversal also visits all the nodes in a tree. It's called "postorder" because the current node is visited after its children. The following tree:
Would be visited in this order:
[2, 3, 7, 9, 12, 10, 8, 5]
Interactive example available with JavaScript enabled.
Our data team didn't like the way we ordered the users in our BST export (personally I think they just want to kick the work for themselves down the road). Anyhow, we've been asked to change it.
Implement the recursive postorder method. Here are the algorithm's steps: