Preorder
Preorder just visits the root first:
- the root, then
- left subtree, then
- right subtree
Postorder
Postorder just visits the root last:
- left subtree, then
- right subtree, then
- the root
(Draw some examples)
If the preorder listing is given, can you determine the original tree?
Example
Preorder: 40 50 80 60 90
Draw the tree?