You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Reverse Polish Notation (RPN), also known as postfix notation, is a way of writing mathematical expressions without the need for parentheses or operator precedence rules. It is closely connected to how compilers evaluate expressions, and it relies on a stack for evaluation. Understanding RPN is essential for A-Level Theory of Computation.
| Notation | Name | Example (3 + 4 × 2) | Operator Position |
|---|---|---|---|
| Infix | Standard | 3 + 4 × 2 | Between operands |
| Prefix (Polish) | Prefix | + 3 × 4 2 | Before operands |
| Postfix (RPN) | Reverse Polish | 3 4 2 × + | After operands |
Infix is what humans use, but it requires:
RPN eliminates both problems. The order of operators and operands alone determines the evaluation.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.