How we evaluate postfix expressions-00009
This subjective question is related to the book/course vu acc311 Fundamentals of Auditing. It can also be found in vu acc311 Mid Term Solved Past Paper No. 1.
Question 1: How we evaluate postfix expressions?
Answer:
Evaluating Postfix Expression
- Each operator in a postfix expression refers to the previous two operands.
- Each time we read an operand, we push it on a stack.
- When we reach an operator, we pop the two operands from the top of the stack, apply the operator and push the result back on the stack.