@Ashish: if i got ur algo correct, contrary to all the above examples, u r forming a linked list of level order traversal of the tree. m i right?
On Jul 17, 8:49 pm, Ashish Goel <ashg...@gmail.com> wrote: > 1. PUSH ROOT IN Q > 2. PUSH DUMMY NODE IN Q, DEFINE PREVIOUS NODE AS NULL > 3. WHILE Q IS NOT EMPTY > 3A. POP CURRENT NODE > 3B. IF CURRENT NODE IS NOT DUMMY > 3B1. IF PREVIOUS, PREVIOUS->SIBLING = CURRENT. > 3B2. PREVIOUS = CURRENT > 3B3. PUSH CURRENT->LEFT, CURRENT->RIGHT TO Q (ONLY IF THE NODES ARE NOT > NULL) > 3C IF CURRENT NODE IS DUMMY > 3C1 IF PREVIOUS, PREVIOUS->SIBLING = NULL; > 3C2 PUSH DUMMY ON Q > > Best Regards > Ashish Goel > "Think positive and find fuel in failure" > +919985813081 > +919966006652 > > > > On Sat, Jul 16, 2011 at 4:16 PM, Reynald <reynaldsus...@gmail.com> wrote: > > Given a Parent -Child binary tree ,build the child -sibling version of > > it? > > Minimize the space requirements wherever possible. > > > -- > > 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.- Hide quoted text - > > - Show quoted text - -- 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.