# Reverse Polish Notation

Reverse Polish notation, or RPN, is an alternative to the familiar infix notation for mathematical expressions in which operations appear

For example, the infix expression

For example

*after*their arguments rather than before or between them.For example, the infix expression

\[
x - y
\]

is written in RPN as
\[
x \; y \; -
\]

One of the advantages of RPN is that it can unambiguously represent expressions without the need for brackets.For example

\[
(x + 1) \times (y - 1)
\]

can be written as
\[
x \; 1 \;+ \; y \; 1 \; - \times
\]