this requires to store the nodes on the tranverse path, which will consume
more storage than constant

 

  _____  

发件人: algogeeks@googlegroups.com [mailto:[EMAIL PROTECTED] 代表
Karthik Singaram Lakshmanan
发送时间: 2008年2月12日 4:40
收件人: algogeeks@googlegroups.com
主题: [algogeeks] Re: a non-recursive algorithm that prints all the nodes of
a binary tree in O(n)

 

keep track of the last node you visited...
if you are coming from the left child, go to the right child...
if you are coming from the right child, go to the parent...
thats the brief idea...




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to