Six original Cambridge-style questions on Reverse Polish notation, with stack traces and mark-scheme solutions.
Explain why compilers convert arithmetic expressions into Reverse Polish notation.
Evaluate the RPN expression 4 2 3 + * 6 2 / −, showing the contents of the stack after each token is processed.
Convert the infix expression A * (B + C) / D into Reverse Polish notation.
Convert (A + B * C) / (D − E) into RPN, then evaluate it when A = 2, B = 3, C = 4, D = 9 and E = 2.
Convert the RPN expression 8 2 5 * + 1 3 2 * + 4 − / into infix and state its value.
An array of 3 elements is used as the stack to evaluate 8 2 5 * + 1 3 2 * + 4 − /. Explain, with reference to the stack contents, why this array is not large enough.
Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.