additionally the space usage can be optimized by using adjacency list Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652
On Sun, Jul 4, 2010 at 11:49 AM, ashgoel <[email protected]> wrote: > wouldn't the inorder and postorder traversals sufficient? save the > inorder and postorder traversals, and compress it while sending, > ensure that that channel is secure > > this is one question that is asked at MS > > > > alternatively, if the tree has say n nodes that a n*n matrix is needed > where a[i][j] represents that i is child of j. > use > http://tech-queries.blogspot.com/2009/04/reconstruct-tree-from-matrix.html > > > > > On Jul 3, 11:30 pm, jalaj jaiswal <[email protected]> wrote: > > You have a General n-ary tree of k levels. There are total of N nodes in > the > > tree. How will you design an algorithm, which will save the tree to a > file > > and reconstruct the whole tree from the saved file later? Design an > > algorithm which require 1. Least amount of CPU time. 2. Least amount of > file > > space. For an N node tree what's the minimum and maximum file space > > required?. > > > > -- > > 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 [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.
