Skip to main content
A-LevelComputer ScienceData types and structures9618/32 · Oct/Nov 2022 · Q1110 Marks

A simplified linked list is used to store the names of flowers in alphabetical order. It is implemented using two 1D arrays: • Flower stores the names of the flowers. • NextPointer stores the pointer to the next flower name in the list. HeadPointer indicates the index of the first flower name in the linked list. HeadPointer 6 When the end of the linked list is reached, the next pointer has the value of 0. The following table shows the initial content of the arrays. Index Flower NextPointer 1 Rose 7 2 Marigold 1 3 Foxglove 10 4 Iris 9 5 Daisy 3 6 Dahlia 5 7 Saxifrage 0 8 Lupin 2 9 Lily 8 10 Hydrangea 4

  1. (a)Several flower names have been deleted from the linked list. These are crossed out in the following table. Complete the table to show the new values of HeadPointer and NextPointer to keep the remaining flower names in alphabetical order. [Figure X.X][3]
  2. (b)Complete the pseudocode algorithm so that it achieves the following when applied to the arrays: • The flower name is input. • The linked list is searched, in order, for the flower name. • If the flower name is found, an appropriate message is output to indicate it has been found. • If the flower name is not found, an appropriate message is output to indicate it has not been found. • The algorithm terminates when the next pointer value is 0. Pointer ← HeadPointer Found ← 0 OUTPUT "Enter a flower name " IF Flower [Pointer] = FlowerName THEN Found ← Pointer Pointer ← 0 ELSE ENDIF ENDWHILE OUTPUT Flower[Found], " is found" ELSE ENDIF[5]
  3. (c)Explain how you could improve the simplified linked list structure.[2]

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

  1. [1] (a) One mark for each point • Correct HeadPointer
  2. [1] (a) • Any three correct NextPointer
  3. [1] (a) • All six NextPointer correct HeadPointer 5 Index Flower NextPointer 1 Rose 0 2 Marigold 3 Foxglove 4 4 Iris 9 5 Daisy 3 6 Dahlia 7 Saxifrage 8 Lupin 1 9 Lily 8 10 Hydrangea
  4. [1] (b) One mark for each correct line Pointer ← HeadPointer Found ← 0 OUTPUT "Enter a flower name " INPUT FlowerName WHILE Pointer <> 0 IF Flower[Pointer] = FlowerName THEN Found ← Pointer Pointer ← 0 ELSE Pointer ← NextPointer[Pointer] ENDIF ENDWHILE IF Pointer = 0 THEN // IF Found = 0 THEN OUTPUT Flower[Found], " is found" ELSE OUTPUT "The flower you wanted is not in the list" ENDIF
  5. [1] (c) One mark for each point (Max 2) • Include a free list pointer
  6. [1] (c) • ... to reuse the unused space
  7. [1] (c) • ... as a linked list of free space.

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 2022 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