1.calculte the postfix of given expression.
2.now remove a particular parenthesis from expression and check if the
postfix of this expression is equal to the postfix of original expression.
if yes then the parenthesis we have removed were extra. if no then the
parenthesis were not exta.
3 now remove other parenthesis as step 2 and repeat till u have done this
for all parenthesis

On 1 June 2010 20:12, Raj N <rajn...@gmail.com> wrote:

> How to remove extra parentheses in an infix string. For example if it
> is A+(B*C) parentheses for * is not required as it has higher
> precedence. Can someone suggest a good routine for this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@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.

Reply via email to