Hello all,
I am working on conversion of infix to postfix expressions, for this the precedence table that I have is like,
precedence order (descending 1 to 4) symbol (operator)
1 parenthesis ()
2 exponentiation ^
3 multiplication * and division /
4 addition + and subtraction –
It was well going, but today I got a new symbol (I don’t know operator or operand) ---- the dollar sign $,
I googled it and in youtube in a “Infix to Postfix Notation” tutorial at “https://www.youtube.com/watch?v=rA0x7b4YiMI” I got ”$ is for representing the power: Eg: 6$2 is equal with 6*6 = 36”
-------- OK I followed it but with this sometimes I got correct result and sometimes not for example,
Infix : A*B+C$ Postfix : A B * C$ +
Infix : A*B+C^ Postfix : A B * C^ + (same result for $ and ^)
Infix : ((A-(B+C)*D)$(E+F)) Postfix : A B C + D * - $ E F +
Infix : ((A-(B+C)*D)^(E+F)) Postfix : A B C + D * - E F + ^ (different results for $ and ^))
One more thing…….. I also want to know the correct algorithm to convert postfix to infix back (with and without parenthesis involved in infix expressions), what I got are algos that don’t take parenthesis into account. Please suggest me the links to books sites etc where I can get it with examples
Please help me as soon as possible, I am in a great need of it for my coming exams.
Please help.
Thanks in advance.