Question 5

OCR Computer Science June 2019 Paper 2A level8 marks

On the specification

(a)
2.3 Algorithms
(b)
2.3 Algorithms
Question text

5 A 1-dimensional array stores the following data: Index 0 1 2 3 4 5 Data 2 18 6 4 12 3 (a) The array needs sorting into descending order. Describe how a merge sort would sort the given array into descending order. [6] (b) An insertion sort can be used to sort the array instead of a merge sort. Explain why an insertion sort might use less memory than a merge sort. [2]