Past-paper question · 2015 May-June · Paper 41 · Q6(b)(i)

Question 6(b)(i) 2015 · May-June · Paper 41 · 59 marks

Original past-paper question for 6(B)(I)
Original past-paper question for 6(B)(I)
Original past-paper question for 6(B)(I)
Reveal official mark-scheme answer Official mark-scheme answer for 6(B)(I)

Official answer for Question 6

Part (b)

(i)

✓
Queue
✓
HeadPointer Name Pointer
✓
0 [1] 2
✓
[2] 3
✓
TailPointer [3] 4
✓
0 [4] 5
✓
[5] 6
✓
FreePointer [6] 7

Mark scheme 9608_s15_ms_41.pdf →

Show text version of question

Question 6

Part (b)

(i)

Question 6

A queue Abstract Data Type (ADT) has these associated operations:

  • create queue
  • add item to queue
  • remove item from queue

The queue ADT is to be implemented as a linked list of nodes.

Each node consists of data and a pointer to the next node. Using pseudocode, a record type, Node, is declared as follows:

TYPE Node DECLARE Name : STRING DECLARE Pointer : INTEGER ENDTYPE

The statement

DECLARE Queue : ARRAY[1:10] OF Node

reserves space for 10 nodes in array Queue.

(i)

The CreateQueue operation links all nodes and initialises the three pointers that need

to be used: HeadPointer, TailPointer and FreePointer.

Complete the diagram to show the value of all pointers after CreateQueue has been executed.

Queue HeadPointer Name Pointer

[1]
[2]

TailPointer

[3]
[4]
[5]

FreePointer

[6]
[7]
[8]
[9]
[10]
[4]

Question 15

Topic relevance

Why this question appears here

91% assigned-topic match · Data types and structures › Introduction to abstract data types

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_s15_qp_41.pdf

Keep practising this topic