Re: Tree traversal without recursion!

Marcel <[email protected]>
Newsgroups gmane.comp.programming.cppug
Message-ID <[email protected]>
to implement algo's without recursion you will have to
implement a stack of your own, each time you would
call the recursive function again, you push your state
to the stack(you have to save the functions
variables), that could be just a pointer to the node
you are visiting right now...and instead returning to
the above instace of the recursive function just pop
the state of the stack and restore it...

>  --- gupta_nkl <[email protected]> schrieb: >
> Please
> let me know, how to implement inorder,
> > postorder, breath first 
> > tree traversal without recursion.
> > 
> > Thanks,
> > Nikhil
> > 
> > 
> >  
> 
>
__________________________________________________________________
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Logos und Klingeltöne fürs Handy bei
> http://sms.yahoo.de
> 
> 
> ------------------------ Yahoo! Groups Sponsor
> 
> To unsubscribe from this group, send an email to:
> [email protected]
> 
>  
> 
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/ 
> 
> 


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/EbFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.