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.5 | 4.2 | 7.8 | 5.1 | 3.9 | 8.4 | 6.1 | 4.8 |
|---|
Row 2 (after merging sublists of size 1):
Row 3 (after merging sublists of size 2):
Final sorted array:
| 3.9 | 4.2 | 4.8 | 5.1 | 6.1 | 6.5 | 7.8 | 8.4 |
|---|
52 exam-style questions on AQA GCSE Computer Science Sorting algorithms. Each one has a worked solution and a mark scheme showing where the marks go.