What is reverse Polish notation?
It’s a postfix way of writing expressions. This eliminates the need for brackets and any confusion over the order of execution.
Why is RPN used?
The order of operations unambiguous and doesn’t need brackets.
Much simpler for computers to evaluate.
How do stacks evaluate RPN?
Starting at the left hand side of the expression, push values onto stack. Operators are not pushed.
Each time an operator is reached, pop the top two values off stack and apply the operator to them.
Push the result of applying the operator to the stack.
Once you reach the end of the expression, the top item on the stack is the result.