Question 2(b)(ii) 2010 · May-June · Paper 33 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
(ii)
(ii)
-Compare centre record with 21478
- If no match, half of remaining file is removed
- If 21478< centre value then remove upper half of remaining records
- Else remove lower half of remaining records
- Repeat until 21478 is found
- Mention of problem if no centre value
Show text version of question
Question 2
Part (b)
(ii)
Question 2
A company uses a computerised payroll system. The company has two factories and employees
only work in one of the factories. Each factory employs a large number of workers. Details of the work done by employees each week is stored serially in two transaction files, one for each factory. When these files are used to create the payroll at the end of the week they have to be merged into a single, sequential file. The final transaction file (T) is the result of merging the two sorted files from the two factories (A and B).
(ii)
Describe a binary search algorithm that can be used to find the details of a particular
employee with ID number 21478 after the files have been merged.
Why this question appears here
75% assigned-topic match · Programming › Constructs
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 9691_s10_qp_33.pdf
