Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 2 of 3.
Write: records are stored in a particular order [1]
The order is decided by the value in a key field [1]
Records are accessed one after the other, starting at the beginning of the file and checking record by record until the required record is found (or the key value is passed) [1]
Divide each key by 5 and write the remainder. 1029 ÷ 5 = 205 remainder 4 (5 × 205 = 1025). 7630 ÷ 5 = 1526 exactly, so the remainder is 0.
| Record key | Hash value |
|---|---|
| 3003 | 3 |
| 1029 | 4 |
| 7630 | 0 |
Write 4 for 1029 [1]
Write 0 for 7630 [1]
▶ Whole paper
Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.