Click on the cat to type in a postfix expression. It will evaluate it for you
The algorithm is simple. When there is a number, push it onto the stack. When there is an operator, pop 2 numbers from the stack, calculate their result and push it onto the stack. Once the algorithm is done, the only number in the stack is the final result. Spaces are required as 23 2 + is not the same as 232+