Skip to main content
A-LevelComputer ScienceAlgorithm design and problem-solving9618/31 · May/June 2021 · Q48 Marks

Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of expressions.

  1. (a)(i)Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of expressions.[2]
  2. (a)(ii)Identify, with reasons, a data structure that could be used to evaluate an expression in RPN.[2]
  3. (b)Write the infix expression in RPN. (a - b) * (a + c) / 7[1]
  4. (c)Write the RPN expression as an infix expression. a b / 4 * a b + -[1]
  5. (d)Evaluate the RPN expression: a b + c d / / where a = 17, b = 3, c = 48 and d = 12. Show your working.[2]

Mark scheme

Marking points from the official mark scheme (May/June 2021). The mark or mark type is shown in brackets.

  1. [1] (a)(i) Reverse Polish Notation provides an unambiguous method of representing an expression
  2. [1] (a)(i) It is read from left to right // without the need to use brackets // with no need for rules of precedence / BODMAS
  3. [1] (a)(ii) Structure: stack
  4. [1] (a)(ii) Reason for stack: The operands are popped from the stack in the reverse order to how they were pushed
  5. [1] (a)(ii) Structure: Binary tree
  6. [1] (a)(ii) Reason for binary tree: A (binary) tree allows both infix and postfix to be evaluated (tree traversal)
  7. [1] (b) a b - a c + * 7 /
  8. [1] (c) a / b * 4 - (a + b)
  9. [1] (d) Correct structure: (a + b) / (c / d)
  10. [1] (d) Correct substitution and evaluation: (17 + 3) / (48 / 12) = 20 / 4 = 5

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
Algorithm design and problem-solving, A-Level Computer Science (syllabus 9618). Structured question, 8 marks.
Source
A-Level Computer Science, May/June 2021 Paper 3 Variant 1, question 4.

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