Q: Explain in your own words that how we evaluate postfix expressions using stack
If the operand is an operand, push the element in the stack as you read the expression from left to right.
If the element is an operator, remove the two operands from the stack and evaluate it.
The evaluation's outcome should be pushed out. Repeat the steps until the statement is finished.
Comments
Leave a comment