Question 3

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

On the specification

(a)
2.1 Algorithms
(b)
2.1 Algorithms2.2 Programming fundamentals
(c)(i)
2.1 Algorithms
(c)(ii)
2.1 Algorithms
Question text

(a) Show the steps that a merge sort would take to put the data set into ascending numerical order. 2, 7, 3, 1, 9, 6, 5, 4 [4] (b) Tick (✓) one box in each table to complete the descriptions. An insertion sort… Tick (✓) one box uses an array of numbers with a sorted part and unsorted part picks out the middle value to begin with merges arrays of numbers together A bubble sort compares pairs of values and then: Tick (✓) one box always swaps them swaps them if they are in the correct order swaps them if they are in the incorrect order A sorting algorithm can sort data in an array. An array: Tick (✓) one box is declared with a fixed length stores multiple values that cannot be changed while the program is running can only be declared with a maximum of one-dimension (1D) [3] (c) An algorithm can be used to search for a value in an array. The algorithm follows these steps: • compares the first value in the array to the value being searched for • stops if the comparison is true • moves to the next value in the array if the comparison if false. (i) Give the name of the searching algorithm described. [1] (ii) Identify one other condition that will cause the algorithm to stop. [1]