9618/32/M/J/23 question 2: worked solution (May/June 2023, paper 32)
Show as plain textHide plain text
Cambridge A2 Level Computer Science 9618 · 13.2 File organisation and access Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 2 of 3. Q24 9618/32/M/J/23 original Q2 Structured · 5 marks Worked solution (a) 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] (b) 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] KEY IDEA A sequential file is kept in key order and read from the start, and a hash value is the remainder after integer division. TOTAL 5 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.