reverse Polish notation

views updated

reverse Polish notation (RPN; postfix notation; suffix notation) A form of notation, invented by the Polish mathematician Jan Lukasiewicz, in which each operator follows its operands. Thus, for example, a + b is written ab+ a + b c is written abc∗+

If each operator has a specific number of operands (e.g. if all operators take exactly two operands), then no brackets are required since the order of evaluation is always uniquely defined; the notation can then be described as parenthesis-free.

The importance of RPN is that an expression in this form can be readily evaluated on a stack. Thus translation to RPN, followed by stack evaluation, is a simple but effective strategy for dealing with arithmetic expressions in a programming language. See also Polish notation.