Hi , To add to your logic, I hope we must also be checking at the precedence of the first operator that appears after the closing parenthesis ')' before we can decided if the parenthesis can be removed or not .
On Thu, Jun 3, 2010 at 11:37 PM, Antony Vincent Pandian.S. < [email protected]> wrote: > If the base logic follows the below rule, it should work. > > If any operator within parenthesis is of less precedence to the > operator before the opening parenthesis, the parenthesis can not be > removed. > > For cases of equal precedence of operators before parenthesis and > within parenthesis, transitivity condition should be checked. If > transitive, parenthesis can be removed else should be retained. Eg: > parenthesis cannot be removed for division operator while can be > removed for multiplicative or addition or subtraction operator. > > On 6/3/10, Rohit Saraf <[email protected]> wrote: > > So there is a prob algoose.... A*(B*C) and a*(b*c+d) > > i hope you understood.... > > > > -- > > -------------------------------------------------- > > Rohit Saraf > > Second Year Undergraduate, > > Dept. of Computer Science and Engineering > > IIT Bombay > > http://www.cse.iitb.ac.in/~rohitfeb14<http://www.cse.iitb.ac.in/%7Erohitfeb14> > > > > -- > > 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. > > > > > > -- > Sent from my mobile device > > Luv, > S.Antony Vincent Pandian > > -- > 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.
