[algogeeks] Re: Building A Special Tree

2011-01-27 Thread bittu
Please Try to Correct it Its Showing Segmentation fault...Reply ASAP... its code for the above program might be not designed in same way...what question..asking ..but i tried..itTry to make is Clear & Executable ... consider tree below 1 / \ 1 0 / \ / \

[algogeeks] Re: Building A Special Tree

2011-01-27 Thread Devil_Fish
Taking a Wild Stab at this problem: This is like evaluating a prefix expression. We know that an expression tree also has either 0 or 2 children and the internal nodes are operators and leaf nodes are operands. In a prefix expression we try to look for the pattern "". If we find such a thing w

[algogeeks] Re: Building A Special Tree

2011-01-20 Thread juver++
something like this: http://pastebin.com/ciG9zTLW -- 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...@googlegrou

[algogeeks] Re: Building A Special Tree

2011-01-20 Thread bittu
@juver++..write ur algo.. & i will see that.. Thanks & Regards Shashank Mani -- 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 al

[algogeeks] Re: Building A Special Tree

2011-01-19 Thread juver++
@above You create your binary tree from scratch. Where is an input data with preorder labels? -- 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, se

[algogeeks] Re: Building A Special Tree

2011-01-19 Thread bittu
N / \ N N / \ / \ N L NL / \ / \ LL LL preorder is given build_CBT(node * root) { if(node==null) print it is CBT; return; if(node->left ==NULL || node->right==NULL) print "impossible"; return; if(node!=NUL

[algogeeks] Re: Building A Special Tree

2011-01-19 Thread juver++
@bittu We have complete binary tree. Preorder information about nodes and leaves is enough. -- 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

[algogeeks] Re: Building A Special Tree

2011-01-19 Thread bittu
How we can build a tree with only one traversal ..i think to build a tree atlesat two traversal required e.g N / \ N N / \ / \ N L NL / \ / \ N NN N so preorder is given by NLL Therefore, following combination can unique

[algogeeks] Re: Building A Special Tree

2011-01-15 Thread bittu
as i think tree is given as its amazon question N / \ N N / \ / \ N L NL / \ / \ N N N N Regards Shashank Mani -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, se

[algogeeks] Re: Building A Special Tree

2011-01-14 Thread Jammy
It's irrelevant but Building Special Tree has the same acronyms as Binary Search Tree...lame joke I know On Jan 14, 8:44 am, vaibhav agrawal wrote: > If it is a BST...then having a pre-order traversal can give us the unique > binary tree. > > Also, as per the problem statement, > > > every node c