...

/

Challenge 6: Evaluate Postfix Expression Using a Stack

Challenge 6: Evaluate Postfix Expression Using a Stack

Try to compute "postfix" mathematical expressions using stacks!

Problem statement

The usual convention followed in mathematics is the infix expression. Operators like + and * appear between the two operands involved in the calculation:

6 + 3 * 8 - 4

Another convention is the postfix expression where the operators appear after the two operands involved in the expression. In postfix, the ...