check this(considering valid input) http://www.ideone.com/Nuhil
On Tue, Oct 4, 2011 at 3:36 PM, Dheeraj Sharma <[email protected]>wrote: > yeah..but am looking for code..that takes the input...as string of > (A(B(E(K,L),F),D(H(M,I),J))) > and returns head of tree.. > > > On Tue, Oct 4, 2011 at 2:11 PM, Raghav Garg <[email protected]>wrote: > >> *you have to check for the braces where they have been used..in comman >> brace that means they are on same level..i am providing answer to your >> problem in attached file.. >> check that out.. >> >> *Raghav garg >> >> >> >> On Tue, Oct 4, 2011 at 1:53 PM, Dheeraj Sharma < >> [email protected]> wrote: >> >>> 1.How to construct a tree from the list representation >>> for ex.- construct tree from (A(B(E(K,L),F),D(H(M,I),J))) >>> the tree would be binary >>> the structure of the node would be >>> >>> struct node{ >>> int data; >>> struct node *left,*right; >>> }; >>> >>> 2.Given a binary tree..give its list representaion..(reverse of above >>> question) >>> >>> -- >>> *Dheeraj Sharma* >>> >>> >>> -- >>> 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. >> > > > > -- > *Dheeraj Sharma* > > > -- > 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.
