Skip to main content
A-LevelComputer ScienceData types and structures9618/32 · Oct/Nov 2023 · Q67 Marks

The Reverse Polish Notation (RPN) expression: ab*2/cd/* is to be evaluated where a = 20, b = 3, c = 10 and d = 5.

  1. (a)Show the changing contents of the following stack as the RPN expression is evaluated. [Figure X.X][4]
  2. (b)Explain how an expression stored in RPN can be evaluated.[3]

This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.

Mark scheme

Marking points from the official mark scheme (Oct/Nov 2023). The mark or mark type is shown in brackets.

  1. [1] One mark per ring (Max 4). (Expected intermediate stack contents showing: [20], [20,3], [60], [60,2], [30], [30,10], [30,10,5], [30,2], [60])
  2. [1] The (RPN) expression is read from left to right, one item at a time
  3. [1] Each element is checked to see if it as operator or a value
  4. [1] Values are pushed onto a stack until an operator is found
  5. [1] The operator is applied to the last two values on the stack and the result is pushed back onto the stack
  6. [1] This repeats until a single value remains, which is the solution.

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Data types and structures, A-Level Computer Science (syllabus 9618). Structured question, 7 marks.
Source
A-Level Computer Science, Oct/Nov 2023 Paper 3 Variant 2, question 6.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep