The I/p to the algo will be an expression like this:
a+(-b)
a*-b+c
i.e any expression that a standard C compiler would support.
Now I've the input already formatted as a stream of tokens , the tokens contain info whether its an operator or an operand. The algorithm should take this in and give me a postfix expression that I can evaluate.
If I use the standard conversion algo, I cant differentiate between an unary and a binary op. Like a*(-b) would give me ab-* ,which would evaluate in the wrong way.
-
, as @Pinole suggested – Thermometer