Write the infix expression for this Reverse Polish Notation (RPN) expression: 5 2 - 5 4 + * 9 /
- (a)(i)Write the infix expression for this Reverse Polish Notation (RPN) expression: 5 2 - 5 4 + * 9 /[2]
- (a)(ii)Show how the contents of the following stack will change as the RPN expression in part (a)(i) is evaluated. [Table showing empty stack columns with 'Working space'][4]
- (b)Explain how a stack can be used to evaluate RPN expressions.[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.
- [2] One mark per mark point (Max 2) (5 – 2) * (5 + 4) /9
- [2] Final correct expression (5 – 2) * (5 + 4) / 9
- [4] One mark per ring (Max 4)
- [1] One mark per mark point (Max 3) MP1 Evaluate the RPN expression from left to right
- [1] MP2 Push each element of the RPN expression onto the stack in order until an operator is reached
- [1] MP3 Pop the last two elements from the stack and apply the operator
- [1] MP4 Push the result of the operation onto the stack
- [1] MP5 Repeat the process until the whole expression is evaluated.
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 →