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

A stack is to be set up using the information in the table. Identifier BasePointer TopPointer Stack Data type INTEGER INTEGER REAL Description points to the bottom of the stack points to the top of the stack 1D array to implement the stack A constant, with identifier Capacity, limits the size of the stack to 25 items.

  1. (a)Write the pseudocode for the required declarations.[3]
  2. (b)Complete the pseudocode function Pop () to pop an item from Stack. // popping an item from the stack FUNCTION Pop() DECLARE Item : REAL Item ← 0 BasePointer THEN Item ← TopPointer ← ELSE OUTPUT "The stack is empty – error" ENDIF ENDFUNCTION[5]
  3. (c)Compare and contrast the queue and stack Abstract Data Types (ADT).[2]

Mark scheme

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

  1. [1] MP1 Correct constant declaration
  2. [1] MP2 Two correct variable declarations
  3. [1] MP3 Correct array declaration Example answer: CONSTANT Capacity = 25 DECLARE BasePointer : INTEGER DECLARE TopPointer : INTEGER DECLARE Stack : ARRAY[1:25] OF REAL
  4. [1] IF TopPointer >= BasePointer THEN
  5. [1] Item ← Stack[TopPointer]
  6. [1] TopPointer ← TopPointer – 1
  7. [1] ELSE
  8. [1] RETURN Item
  9. [1] MP1 A queue is a first in first out / FIFO data structure and a stack is a first in last out / FILO / LIFO data structure // Data is removed from a queue in the order it is received and removed from a stack in the reverse order to which it is received
  10. [1] MP2 Both ADTs can vary in size / are of indeterminate length
  11. [1] MP3 Data is popped and pushed (onto/from a stack) at the same end but it is enqueued and dequeued (to/from a queue) at different/opposite ends // a queue has two accessible ends and a stack has only one
  12. [1] MP4 A stack has only one moveable pointer whereas a queue has two.

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, 10 marks.
Source
A-Level Computer Science, Oct/Nov 2023 Paper 3 Variant 3, question 10.

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