Data Structures & AlgorithmsHardTCS NQT · Infosys

Evaluate the Reverse Polish expression 10 6 9 3 + -11 * / * 17 + 5 +. What is the result?

  1. A. 23
  2. B. 24
  3. C. 26
  4. D. 22

Correct answer: D. 22

Operands are pushed; each operator pops two and pushes the result. The intermediate values are 12, then -132, then 6 / -132 truncates to 0, so the product is 0; the final additions give 22.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic