you  will use stack, and you have 2 kind of values in stack, one is visit
node first time, and second is wisit node for second time

when first time:  you put visit this node for second time and then you put
visit nododes for first time to stack for all descendands

when second time: you calculate value, and store it in array


if you want to just print the order, you only write its value when you are
second time in the node


This approach is not simulation of procedure call. It is more like using
Stack instead of queue, in BFS search, to get DFS search.


2009/1/18 algorithm <prabagara...@gmail.com>

>
> how to solve post - order traversal without using recursion ?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to