Using BFS we can do it. Thanks, Sathaiah
On Thu, May 13, 2010 at 6:48 PM, Dave <[email protected]> wrote: > Do a post-order traversal, keeping track of the level in the tree. As > you visit each node, remove it from the tree and add it to the spike. > Use the left pointer to point to the next level, and the right tree > pointer for each level of the spike. If you visit the right subtrees > before the left subtrees, then you can add the nodes to the beginning > of the linked list for its level in the spike. > > Dave > > On May 12, 10:48 pm, vinayan c <[email protected]> wrote: > > Something like this > > 1 > > 2 3 > > 4 5 6 7 > > > > 1 > > | > > 2->3 > > | > > 4->5->6->7 > > > > -- > > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > > For more options, visit this group athttp:// > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
