One of the most useful characteristics of a postfix expression is that the value of such an expression can be computed easily with the aid of a stack of values. The components of a postfix expression are processed from left to right as follows:

- If the next component of the expression is an operand, the value of the component is pushed onto the stack.
- If the next component of the expression is an operator, then its operands are in the stack. The required number of operands are popped from the stack; the specified operation is performed; and the result is pushed back onto the stack.

**Figure:** Evaluating the RPN Expression in Equation using a Stack

Copyright © 1997 by Bruno R. Preiss, P.Eng. All rights reserved.