When I try to convert infix expression to postfix expression,
3*(3+6/2)
it will be converted to like this.
3362/+*
My problem is this, how can I handle if there is negative sign in front of parantheses? Like
3*-(3+6/2)
or 3*(-(3+6/2))
When I try to convert these to postfix expressions, it would be like
3*362/+-
and 3362/+-*
, but none of these expressions are valid: I cannot calculate these expressions in common way which we use to calculate postfix expressions.
So is there any way to handle these?