The GATE Grind

GATE 2015 CS (CS3) – Question 28

Programming and Data Structures · Stacks and Queues · 1 mark · Multiple choice

Evaluate the postfix expression: 10 5 + 60 6 / * 8 − .

  1. 284
  2. 213
  3. 142
  4. 71

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) 142

Explanation

Use a stack: ten plus five gives fifteen; sixty divided by six gives ten. Multiply the two results to obtain one hundred fifty, then subtract eight, giving one hundred forty-two. Thus C.

More Stacks and Queues questions

All Stacks and Queues questions →