| OCR |
GCSE (9-1) Computer Science
Mark Scheme
J277/02: Unit 2.1 Standard Sorting Algorithms
|
| Question | Answer | Marks | Guidance |
|---|---|---|---|
| 1a |
[ "Alan", "Cian", "Ben", "Dave" ]
|
2 |
Examiner Note: The largest value must be at the end after Pass 1.
|
| 1b |
|
2 | |
| 2a |
[ 5, 12, 18, 1, 9 ]
|
2 |
Note: Students often mistakenly sort the whole list. This question asks for the state after the second insertion (index 2).
|
| 2b |
|
3 | |
| 3a |
[15] [3] [9] [12] [6] [2]
|
2 |
2 marks for individual lists.
1 mark if pairs are shown. J277 requires showing the "Divide" stage down to single items.
|
| 3b |
|
3 | |
| 4 |
Merge Sort Advantage: Much faster/more efficient on large lists (1). Time complexity is lower (O(n log n)) compared to Bubble Sort (1). Bubble Sort Advantage: Easier to write/code (1). Uses less memory (does not create new sub-lists) (1). |
4 | |
| 5a | Line 07 | 1 |
It checks if scores[i] < scores[i+1], it should be >.
|
| 5b | Line 06 | 1 |
for i = 0 to n - 1 causes out of bounds when accessing i+1. |
| 5c |
|
2 | |
| 6 |
Logic Points: 1. Outer Loop: Iterates from index 1 to end (1). 2. Store Value: current = data[i] (1).3. Inner Loop Setup: j = i - 1 (1).4. Comparison: Checks data[j] > current AND j >= 0 (1).5. Shift: Moves item right data[j+1] = data[j] (1).6. Insert: Places item data[j+1] = current (1).
|
6 |
Accept Pseudocode or Python-style syntax.
|
| 7a | Insertion Sort | 1 | |
| 7b |
|
2 | |
| 8 | It breaks the large list down into smaller sub-lists (1) until each list contains only one item (1). | 2 | |
| 9 |
while swap == True OR while sorted == False
|
2 |
Must imply the loop continues as long as swaps are happening.
|
| 10 |
(a) Comparison: False (or No) (1). (b) Action: No change / Leave 5 in place (1). |
2 |