- GATE CS
- 2026–27 pattern practice
- Data Structures
- Stacks and queues
- Easy
What is the value of the postfix expression ?
Linear Structures
Pick an option to check your answer.
Answer: A. Solution
Evaluate with a stack (push operands, pop two on each operator):
- Push .
- : pop → push . Stack:
- : pop → push . Stack:
- Push ; : pop → push .
The infix form is .
Why not the others
- stops before the final , ignoring the .
- pops the operands of in the wrong order (); the first popped value is the right operand.
- treats as : .