May/June 2026 Paper 21

2026 · 9 questions · 28 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong28Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
7(a)(i)Stacks QueuesEasy1 mark
Different data structures will be suitable for different computing applications. Identify a computing application where a queue data structure is suitable.

Answer

0 words
7(a)(ii)Stacks QueuesMedium2 marks
Justify why a queue is suitable for your application identified in 7(a)(i).

Answer

0 words
7(b)(i)Stacks QueuesEasy2 marks
A programmer designs a circular queue.
  • The data items are stored in a 1D array, MyQueue
  • The queue is managed using two pointers.
The diagram shows the circular queue populated with four items.
MyQueue — four items stored
IndexValuePointer
1"PIG"Front
2"DOG"
3"RAT"
4"SPIDER"Rear
5
6
7
8
Write three pseudocode declaration statements to implement this circular queue.
Declare the array
Declare the two pointers
7(b)(ii)Stacks QueuesMedium2 marks
Two program modules are available to add and remove items to and from the queue.
moduledescription
EnQueue()when is added to the queue
DeQueue()when an item is removed from the queue
Complete the state of MyQueue after the following sequence of changes:
  • DeQueue()
  • EnQueue("HORSE")
  • EnQueue("CAT")
IndexValuePointer
1
2
3
4
5
6
7
8
7(b)(iii)Stacks QueuesHard2 marks
On a different occasion, the state of MyQueue is:
IndexValuePointer
1
2
3
4"LION"Front
5"GIRAFFE"
6"TIGER"
7"ANT"Rear
8
Complete the state of MyQueue after the following sequence of changes:
  • EnQueue("GERBIL")
  • EnQueue("MONKEY")
  • EnQueue("SNAKE")
  • DeQueue()
IndexValuePointer
1
2
3
4
5
6
7
8
7(c)Stacks QueuesMedium3 marks
MyQueue will be initially empty. Write a pseudocode procedure InitialiseQueue() to set up the empty MyQueue, using a loop. The initial array contents will be set to empty strings. You are not required to repeat the declaration statements in 7(b)(i).
text
PROCEDURE InitialiseQueue()   …ENDPROCEDURE
Write the body of InitialiseQueue()
0 words