Evaluating postfix expression using stack
We have seen the conversion of infix to postfix expression here. Now lets see how to evaluate it.
Algorithm
Scan input expression from left to right If scanned input is an operand, push it into the stack If scanned input is an operator, pop out two values from stack. Then, perform operation between popped values and then push back the result into the stack. Repeat above two steps till all the characters are scanned.
[Read More]