Skip to main content
A-LevelComputer ScienceData types and structures9618/21 · Oct/Nov 2021 · Q313 Marks

The diagram below represents a queue Abstract Data Type (ADT) that can hold a maximum of eight items. The operation of this queue may be summarised as follows: • The front of queue pointer points to the next item to be removed. • The end of queue pointer points to the last item added. • The queue is circular so that empty storage elements can be reused. 0 Frog ← Front of queue pointer 1 Cat 2 Fish 3 Elk ← End of queue pointer 4 5 6 7 Describe how “Octopus" is added to the given queue.

  1. (a)(i)The diagram below represents a queue Abstract Data Type (ADT) that can hold a maximum of eight items. The operation of this queue may be summarised as follows: • The front of queue pointer points to the next item to be removed. • The end of queue pointer points to the last item added. • The queue is circular so that empty storage elements can be reused. 0 Frog ← Front of queue pointer 1 Cat 2 Fish 3 Elk ← End of queue pointer 4 5 6 7 Describe how “Octopus" is added to the given queue.[2]
  2. (a)(ii)Describe how the next item in the given queue is removed and stored in the variable AnimalName.[2]
  3. (a)(iii)Describe the state of the queue when the front of queue and the end of queue pointers have the same value.[1]
  4. (b)(i)Some operations are carried out on the original queue given in part (a). The current state of the queue is: 0 Frog 1 Cat 2 Fish 3 Elk 4 5 6 7 Complete the diagram to show the state of the queue after the following operations: Add "Wasp", "Bee” and “Mouse”, and then remove two data items.[3]
  5. (b)(ii)The state of the queue after other operations are carried out is shown: 0 Frog 1 Cat 2 Fish 3 Elk ← Front of queue pointer 4 Wasp 5 Bee 6 Mouse ← End of queue pointer 7 Ant Complete the following diagram to show the state of the queue after the following operations: Remove one item, and then add "Dolphin" and "Shark”. 0 1 2 3 4 5 6 7[2]
  6. (c)The queue is implemented using a 1D array. Describe the algorithm that should be used to modify the end of queue pointer when adding an item to the queue. Your algorithm should detect any potential error conditions.[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 2021). The mark or mark type is shown in brackets.

  1. [2] One mark per point:
  2. • EoQ pointer will move to point to location 4 // incremented EoQ (by 1)
  3. • Data value "Octopus" will be stored in location pointed to be EoQ / location 4
  4. [2] One mark for each bullet
  5. • Value "Frog" // value pointed to by FoQ / location 0 is assigned to variable AnimalName
  6. • FoQ pointer will move to point to location 1 / point to "Cat" // incremented FoQ (by 1)
  7. [1] There is only one data item in the queue
  8. [3] One mark for data values plus one mark for pointers
  9. 0 Frog
  10. 1 Cat
  11. 2 Fish ← Front of queue pointer
  12. 3 Elk
  13. 4 Wasp
  14. 5 Bee
  15. 6 Mouse ← End of queue pointer
  16. 7
  17. One mark for each pointer
  18. One mark for three new data values
  19. [2] 0 Shark ← End of queue pointer
  20. 1 (Cat)
  21. 2 (Fish)
  22. 3 (Elk)
  23. 4 Wasp ← Front of queue pointer
  24. 5 Bee
  25. 6 Mouse
  26. 7 Dolphin
  27. One mark for BOTH pointers
  28. One mark for all data values as shown
  29. [3] One mark per point:
  30. 1 If incremented EoQ = FoQ then error condition: queue is full
  31. 2 Increment the EOQ
  32. 3 Manage wrap-around

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, 13 marks.
Source
A-Level Computer Science, Oct/Nov 2021 Paper 2 Variant 1, question 3.

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