We can do 4 type of treversal. If we do inorder then we will get sorted array .If we do an inorder traversal then we would get a sorted list which if we convert into a BST would again become a list and we would loose out on the original structure of the tree.
and same will be happen with post order now remaining preorder and level order. when we do level order traversal it will require more space as it uses BFS approach .So to do in o(logn) we do preorder travesal. On Sat, Jul 3, 2010 at 5:46 AM, jalaj jaiswal <jalaj.jaiswa...@gmail.com>wrote: > serialize... is it level order traversal ??? > give an example...? > > > On Sat, Jul 3, 2010 at 12:36 PM, divya <sweetdivya....@gmail.com> wrote: > >> Design an algorithm and write code to serialize a binary tree. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > > > -- > With Regards, > Jalaj Jaiswal > +919026283397 > B.TECH IT > IIIT ALLAHABAD > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > 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 algoge...@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.