Question 2

OCR Computer Science November 2021 Paper 2GCSE9 marks

On the specification

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

2 An insertion sort is used to put the following words into ascending alphabetical order. pumpkin flour wall house wall (a) Tick (3) one box in each row to identify whether each statement about the insertion sort is true or false. Statement True (3) False (3) The list of words is initially split into a sorted set and an unsorted set. The insertion sort uses a divide stage and then a conquer stage. The list of words must be in order before the insertion sort can start. Each word is inserted into the correct place in the array, one by one. The insertion sort will not work because the word “wall” appears twice. [5] (b) The sorted list of words is shown below. flour house pumpkin wall wall Explain how a binary search would be used to try to find whether the word “house” appears in this list. [4]