PostOrder traversal
  In PostOrder traversal, each node is processed after subtrees traversal.In
  simpler words,Visit left subtree,  right subtree and then node.
  Steps for PostOrder traversal are:
- 
      Traverse the left subtreein PostOrder.
- 
      Traverse the right subtreein PostOrder.
- 
      Visitthe node
There can be two ways of implementing it
- Recursive
- Iterative
Recursive solution
The recursive solution is very straightforward. The below diagram will make you understand recursion better.
Code for recursion will be:
Iterative solution:
Steps for iterative solution:
- 
        Create an empty stack sand setcurrentNode =root.
- 
        while currentNodeis not NULL Do following- 
            Push currentNode 's right childand thencurrentNodeto stacks
- 
            Set currentNode=currentNode.left
 
- 
            Push 
- 
        Pop a node from stack sand set it tocurrentNode- 
            If the popped node has a right childand the right child is at top of stack, thenremovethe right child from stack, push thecurrentNodeback and setcurrentNodeascurrentNode 's right child.
- 
            Else print currentNode's dataand setcurrentNodeas NULL.
 
- 
            If the popped node has a 
- Repeat steps 2 and 3 while stack is not empty.
Run above program and you will get following output:

 
 
