⟩ What is pre-order and in-order tree traversal?
A non-empty binary tree is traversed in 3 types, namely pre-order, in-order and post-order in a recursive fashion.
Pre-order:
Pre-order process is as follows:
- Visit the root node
- Traverse the left sub tree
- Traverse the right sub tree
In-Order:
In order process is as follows:
- Traverse the left sub tree
- Visit the root node
- Traverse the right sub tree