Infix to Postfix/Reverse Polish Notation

449 Views Asked by At

If I wanted to convert this from infix to postfix:

3 + ( 8 – ( ( 6 – 2 ) ) ) / ( 4 + 5 )

Would this be correct?:

3 8 6 2 - - + 4 5 + /

Also, if I wanted to evaluate this:

3 8 6 2 - - 4 5 + / +

Would it simplify to this?:

31/9
1

There are 1 best solutions below

0
George Udosen On BEST ANSWER

This: 3 + ( 8 – ( ( 6 – 2 ) ) ) / ( 4 + 5 ) would return A B C D - - E F + / + and

yes this:3 8 6 2 - - 4 5 + / + simplifies to 31 / 9