Past-paper question · 2017 May-June · Paper 41 · Q2(a)

Question 2(a) 2017 · May-June · Paper 41 · 4 marks

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

Official answer for Question 2

Part (a)

Question 1

mark for the declaration of the array.

Question 4

✓
1 mark for assigning a 0 to Customer ID (CustomerID ← 0)
✓
1 mark for getting the correct record (Customer[x].)
✓
1 mark for setting up a loop to go from 0 to 199
✓
DECLARE Customer : ARRAY[0 : 199] OF CustomerRecord

Question 1

✓
FOR x ← 0 TO 199

Question 1

✓
Customer[x].CustomerID ← 0
✓
1+1
✓
ENDFOR

Mark scheme 9608_s17_ms_41.pdf →

Show text version of question

Question 2

Part (a)

Question 2

A hash table has these associated operations:

  • create hash table
  • insert record
  • search hash table
A
hash table is to be used to store customer records.

Each record consists of a unique customer ID, the record key, and other customer data.

Part (a)

The following pseudocode declares a customer record structure.

TYPE CustomerRecord CustomerID : INTEGER Data : STRING ENDTYPE

The hash table is to be implemented as a 1D array Customer with elements indexed 0 to 199. The procedure to create a hash table will declare and initialise the array by storing 200 records with the CustomerID field in each record set to 0.

Complete the pseudocode.

PROCEDURE CreateHashTable()

............................................................................................................................................

............................................................................................................................................

............................................................................................................................................

............................................................................................................................................

ENDPROCEDURE

[4]
Topic relevance

Why this question appears here

92% 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 9608_s17_qp_41.pdf

Keep practising this topic