Re: [algogeeks] Re: Non recursive preorder and postorder
u can use threaded binary trees to avoid stacking On Mon, Aug 15, 2011 at 9:48 PM, Navneet wrote: > I think only condition given is not to use recursion, so auxiliary > data structures can be used. > > > On Aug 15, 7:30 pm, ankit sambyal wrote: > > Morris in order traversal will do in order traversal without using > recursion > > or a stack. > > -- > 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?hl=en. > > -- 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?hl=en.
[algogeeks] Re: Non recursive preorder and postorder
I think only condition given is not to use recursion, so auxiliary data structures can be used. On Aug 15, 7:30 pm, ankit sambyal wrote: > Morris in order traversal will do in order traversal without using recursion > or a stack. -- 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?hl=en.
Re: [algogeeks] Re: Non recursive preorder and postorder
Morris in order traversal will do in order traversal without using recursion or a stack. -- 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?hl=en.
[algogeeks] Re: Non recursive preorder and postorder
It can be done without using a stack, by using the pointers in the node to keep track of the path back up the tree. The algorithm will temporarily modify the tree, but when completed the tree will be restored to its original state. Don On Aug 15, 8:07 am, rohit wrote: > Can anyone give algorithm for non recursive preorder and postorder?? -- 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?hl=en.