oh bhai mere..... kewal preorder use karke kaise tree bana dega??? On Fri, Jun 29, 2012 at 11:23 PM, amrit harry <dabbcomput...@gmail.com>wrote:
> @bhaskar ur algo fails on this case (5+3)-(2+(3/6)) > -+53+2/36 > 63/2+35-+ > showing that 6/3 but actually it is 3/6 > so i think it could be done by folowing algo > make a binary tree of given expression in O(n) then do postorder > traversal take O(n) so problem can be solved in O(n). and take O(2*n+1) > space > > On Fri, Jun 29, 2012 at 9:13 PM, Bhaskar Kushwaha < > bhaskar.kushwaha2...@gmail.com> wrote: > >> I think just reversing the prefix notation converts it to postfix notation >> >> >> On Fri, Jun 29, 2012 at 7:46 PM, Gobind Kumar Hembram < >> gobind....@gmail.com> wrote: >> >>> Given an integer expression in a prefix format (i.e. the operator >>> precedes the number it is operating on) , print the expression in the >>> post fix format . >>> >>> Example: If the integer expression is in the prefix format is *+56-78, >>> the postfix format expression is 56+78-*. Both of these >>> correspond to the expression (5+6)*(7-8). >>> >>> -- >>> 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...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >> >> >> -- >> regards, >> Bhaskar Kushwaha >> Student >> Final year >> CSE >> M.N.N.I.T. Allahabad >> >> -- >> 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...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Thanks & Regards > Amritpal singh > > -- > 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...@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 algogeeks@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.