Past-paper question · 2021 May-June · Paper 42 · Q1(a)

Question 1(a) 2021 · May-June · Paper 42 · 2 marks

Original past-paper question for 1(A)
Original past-paper question for 1(A)
Reveal official mark-scheme answer Official mark-scheme answer for 1(A)

Official answer for Question 1

Part (a)

Question 1

mark per bullet point

Question 2

  • Declaring record/class with name node…
  • …declaring data and next node (both as Integers)
✓
Example code:
✓
Visual Basic
✓
Structure node
✓
Dim Data As Integer
✓
Dim nextNode As Integer
✓
End Structure
✓
Python
✓
class node:
✓
def __init__(self, theData, nextNodeNumber):
✓
self. Data = theData
✓
self.nextNode = nextNodeNumber
✓
Java
✓
class node{
✓
private Integer Data;
✓
private Integer nextNode;
✓
public node(Integer dataP, Integer nextNodeP){
✓
this.Data = dataP;
✓
this.nextNode = nextNodeP;
✓
}
✓
}
✓
9618/42
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2021
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s21_ms_42.pdf →

Show text version of question

Question 1

Part (a)

Question 1

An unordered linked list uses a 1D array to store the data.

Each item in the linked list is of a record type, node, with a field data and a field nextNode.

The current contents of the linked list are:

startPointer 0 Index data nextNode 0 1 1 emptyList 5 1 5 4 2 6 7 3 7 -1 4 2 2 5 0 6 6 0 8 7 56 3 8 0 9 9 0 -1

Part (a)

The following is pseudocode for the record type node.

TYPE node

DECLARE data : INTEGER

DECLARE nextNode : INTEGER

ENDTYPE

Write program code to declare the record type node.

Save your program as question1.

Copy and paste the program code into part 1(a) in the evidence document.

[2]

Question 3

Topic relevance

Why this question appears here

71% assigned-topic match · Data types and structures › Data types and records

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 9618_s21_qp_42.pdf

Keep practising this topic