2
0/3

An environmental scientist measures the pH level of soil samples collected at regular intervals along a transect. The eight pH values obtained, in order, are: 6.5, 4.2, 7.8, 5.1, 3.9, 8.4, 6.1, 4.8

To analyze the acidity distribution, the scientist uses a merge sort algorithm to order these values from most acidic (lowest pH) to least acidic (highest pH).

Complete the table below to show how the merge sort algorithm operates on this list of pH values.

The first row shows the starting array, and the final row shows the sorted array. Fill in the values for the two intermediate rows showing the steps of the merge process.

Starting array:

6.54.27.85.13.98.46.14.8

Row 2 (after merging sublists of size 1):

Row 3 (after merging sublists of size 2):

Final sorted array:

3.94.24.85.16.16.57.88.4
[3]

Sorting algorithms Questions

Practise AQA GCSE Computer Science Sorting algorithms with exam-style questions for GCSE Computer Science. 62 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Sorting algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Sorting algorithms