Preorder Traversal |
Postorder Traversal |
Inorder Traversal
- Traverse the left subtree.
- Traverse the right subtree.
- Visit the root.
For those of us who are visual learners, the postorder traversal of a binary tree would look like this.
F depth = 0
/ \
B E depth = 1
/ / \
A C D depth = 2