@Gene : if i am not wrong , level order traversal can be done using only 1 queue....why 2 queue???
On Sun, Dec 11, 2011 at 9:53 PM, AMAN AGARWAL <[email protected]> wrote: > Hi, > > Suppose we have a binary search tree as 15,12,18,17,21,11,14 > then O/P will be 15 12 18 21 17 14 11. > so the successor of 15 is 12 the successor of 12 is 18 and so on. > > I hope now its clear. > > > Regards, > Aman. > > > On Sun, Dec 11, 2011 at 6:26 PM, WgpShashank > <[email protected]>wrote: > >> @atul zig-zag mean spiral traversal of tree e.g. alternate the level >> while traversing , if previous traversal is left to right , then next level >> will be right to left . >> >> @aman .quest has little ambiguity its says successor but ebvery nodes can >> have we can ore-order , inorder ,postorder successor isn't it ?? but i am >> assuming u r interesting in pre-order succesor so then 1st find the >> per-order successor of each node & then set it , finally traverse it ? >> >> correct me if i am wrong ? >> >> Thanks >> Shashank Mani >> Computer Science >> BIT Mesra >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/algogeeks/-/b51VObaoMZIJ. >> >> 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. >> > > > > -- > AMAN AGARWAL > "Success is not final, Failure is not fatal: It is the courage to continue > that counts!" > > -- > 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. > -- 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.
