binary tree traversal ..

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2006
Posts: 147
Reputation: Laiq Ahmed will become famous soon enough Laiq Ahmed will become famous soon enough 
Solved Threads: 20
Laiq Ahmed Laiq Ahmed is offline Offline
Junior Poster

Re: binary tree traversal ..

 
0
  #11
Jul 13th, 2006
I can just explain you how to code on code it in any language of your desire

Algorithm Suggest: -
i) visit the left Subtree
ii) visit the Node
iii) visit the right Subtree

You are interested in making the Non Recursive version of the above traversal. You can make it easily... if you know how recursion attempts the problem, infact recusion is using the implicit stack. So you might use an explicit stack to tackle the same problem . My Suggessions are first try to solve it by hand then you'll get the idea what infact you are doing then try to code the logic.
Give me your code of recursive Version I'll give you mine (non recursive version :d).......

Hope you get the basic idea........
Last edited by Laiq Ahmed; Jul 13th, 2006 at 1:41 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC