Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reverse Polish Notation
#2
It can also be 2 9 7 - / for it to work.

If you want to visualize it:


InputOperationStack
2Push Back[2]
9Push Back[2,9]
7Push Back[2,9,7]
-Subtract[2,(9-7)]
-Push Result[2,2]
/Divide[(2/2)]
/Push Result[1]


Likewise, I think yours is still correct.


InputOperationStack
9Push Back[9]
7Push Back[9,7]
-Subtract[9-7]
-Push Result[2]
2Push Back[2,2]
/Divide[2/2]
/Push Result[1]
Reply


Messages In This Thread
Reverse Polish Notation - by Imagine - 2013-04-06, 10:46 PM
Reverse Polish Notation - by Locked - 2013-04-06, 11:16 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)