Skip to main content
A-LevelComputer ScienceData types and structures9618/32 · May/June 2023 · Q1110 Marks

The pseudocode shown represents a queue Abstract Data Type (ADT) with procedures for initialisation and to add new items. It is incomplete.

  1. (a)(i)Study the pseudocode and insert the identifiers to complete this table. Identifier Data type Description STRING INTEGER INTEGER INTEGER An array to store the contents of the queue. Points to the last item of the queue. Indicates the number of items in the queue. Points to the first item of the queue.[2]
  2. (a)(ii)Complete the given pseudocode.[5]
  3. (b)Explain the reasons why a queue ADT works better than a stack ADT in organising print jobs.[3]

Mark scheme

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

  1. [2] One mark for every two correct identifiers (Max 2) Identifier Data type Description Queue STRING An array to store the contents of the queue. RearPointer INTEGER Points to the last term of the queue. Length INTEGER Indicates the number of items in the queue. FrontPointer INTEGER Points to the first term of the queue.
  2. [5] One mark for each correctly completed line (Max 5) CONSTANT MaxLength = 50 DECLARE FrontPointer : INTEGER DECLARE RearPointer : INTEGER DECLARE Length : INTEGER DECLARE Queue : ARRAY[0:MaxLength - 1] OF STRING // Initialisation of queue PROCEDURE Initialise FrontPointer ← -1 RearPointer ← -1 Length ← 0 ENDPROCEDURE // Adding a new item to the queue PROCEDURE Enqueue(NewItem : STRING) IF Length < MaxLength THEN // IF Length <= MaxLength - 1 THEN RearPointer ← RearPointer + 1 IF RearPointer > MaxLength - 1 THEN RearPointer ← 0 ENDIF Queue[RearPointer] ← NewItem Length ← Length + 1 ENDIF ENDPROCEDURE
  3. [3] One mark per mark point (Max 3) • Print jobs are expected to be actioned by the printer in the order they are received • ... because the printer queue is a queue, the first job to be sent to the printer would be the first job printed. • If the printer queue was on a stack, the first job the printer received would not be printed until all the other jobs have been printed.

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, May/June 2023 Paper 3 Variant 2, question 11.

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