Question 3

OCR Computer Science June 2022 Computational thinking, algorithms and programming (J277-02)GCSE9 marks

On the specification

(a)
2.1 Algorithms
(b)
2.1 Algorithms
(c)
2.1 Algorithms
Question text

3 A program stores the following list of positive and negative numbers. The numbers need sorting into ascending order using a merge sort. 45 12 –99 100 –13 0 17 –27 (a) The first step is to divide the list into individual lists of one number each. This has been done for you. Complete the merge sort of the data by showing each step of the process. 45 12 –99 100 –13 0 17 –27 [3] (b) Once the numbers are in order, a binary search can be run on the data. Describe the steps a binary search will follow to look for a number in a sorted list. [4] (c) A linear search could be used instead of a binary search. Describe the steps a linear search would follow when searching for a number that is not in the given list. [2]