What are diffent traversal techniques on tree
There are broadly 3 traversal techniques used on Tree which are namely :
1. PreOrder
2. InOrder
3. PostOrder.
As we know traversing means visiting the nodes of tree in order to get some value that we want to search. Which can be done in these ways.
Tree consists of Left part Root and its Right part.
Preorder means traversing (Root Left Right), which means first visit the root then its left child and then right one.
Inorder means traversing (Left Root Right), which means Visit first the left part then Root and then Right part.
Postorder means traversing (Left Right Root), which means visit first the left part then the right part and then the root in the end.