Skip to main content
A-LevelComputer ScienceData types and structures9618/21 · May/June 2022 · Q46 Marks

A stack is created using a high-level language. Memory locations 200 to 207 are to be used to store the stack. The following diagram represents the current state of the stack. TopOfStack points to the last value added to the stack. Stack Pointer Memory location | Value ---|--- 200 | 201 | 202 | 203 | 'F' <- TopOfStack 204 | 'C' 205 | 'D' 206 | 'E' 207 | 'H'

  1. (a)Complete the following table by writing the answers. | Answer ---|--- The value that has been on the stack for the longest time. | The memory location pointed to by TopOfStack if three POP operations are performed. |[2]
  2. (b)The following diagram shows the current state of the stack: Stack Pointer Memory location | Value ---|--- 200 | 201 | 202 | 'W' <- TopOfStack 203 | 'Y' 204 | 'X' 205 | 'Z' 206 | 'N' 207 | 'P' The following operations are performed: POP POP PUSH 'A' PUSH 'B' POP PUSH 'C' PUSH 'D' Complete the diagram to show the state of the stack after the operations have been performed. Stack Pointer Memory location | Value ---|--- 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 |[4]

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 (May/June 2022). The mark or mark type is shown in brackets.

  1. [2] (a) The value that has been on the stack for the longest time.: 'H'
  2. [2] (a) The memory location pointed to by TopOfStack if three POP operations are performed.: 206
  3. [2] (a) One mark per row
  4. [4] (b) One mark for: TopOfStack pointing to 'D'
  5. [4] (b) One mark for: Value 'D' in 201
  6. [4] (b) One mark for: Values 'C' & 'A' in 202 and 203
  7. [4] (b) One mark for: Values 'X' to 'P' unchanged (204 to 207)

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, 6 marks.
Source
A-Level Computer Science, May/June 2022 Paper 2 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