GCSE (9-1) Computer Science
Mark Scheme
J277/02: Unit 2.1.2 Searching Algorithms
Question Answer Marks Guidance
1a The list must be sorted / in order. 1
Accept: "Alphabetical order" or "Ascending/Descending order".
1b Because Linear Search checks every item sequentially (one by one), so order does not matter. 1
2
  • Checks every item: Linear Search
  • Calculates midpoint: Binary Search
  • Faster for large, sorted lists: Binary Search
3
1 mark per correct row.
3a 7 (items) 1
Sam is the 7th item.
3b
  • The algorithm will check every item in the list (from Ali to Zoe) (1).
  • It will reach the end of the list without finding "Ben" and report "Not Found" (1).
2
Must imply iterating through the whole list.
4 Step 2:
New Range: Indices 5 to 8.
Midpoint calculation: (5 + 8) / 2 = 6.5 -> 6.
Value at index 6 is 22.
22 > 19, so discard right half.

Step 3:
New Range: Indices 5 to 5.
Midpoint calculation: (5 + 5) / 2 = 5.
Value at index 5 is 19.

Result: Item found at index 5.
4
1 mark for correct midpoint calculation at Step 2 (index 6).
1 mark for correct comparison (22 > 19) and direction change.
1 mark for correct midpoint at Step 3 (index 5).
1 mark for finding the item.
5 Row 2:
Low: 0, High: 3, Mid: 1, Value: 5 (1)

Row 3:
Low: 0, High: 0, Mid: 0, Value: 2 (1)

Correct Sequence (1):
Correct sequence of narrowing down to the left.
3
Allow Follow Through if calculation error in row 2.
Note: Logic is (0+3)/2 = 1 (int div).
6
  • The list is not sorted / unordered (1).
  • Binary Search relies on the list being ordered to discard half; here, discarding half might throw away the target (1).
2
7
  1. target (1)
  2. True (1)
  3. index (1)
  4. Not Found (1)
4
Accept equivalent logic (e.g. item if consistent).
8 Any 5 steps from:
  • Find the midpoint of the list (1).
  • Compare midpoint value to target (1).
  • If midpoint matches target, stop (found) (1).
  • If target is lower than midpoint, discard right half (focus on left) (1).
  • If target is higher than midpoint, discard left half (focus on right) (1).
  • Repeat until found or list is empty (1).
5
Max 5 marks.
Must mention "midpoint" and the concept of "discarding" or "splitting".
9
  • Linear Search: Worst case checks 1,000,000 items (1). Very slow/inefficient (1).
  • Binary Search: Worst case checks approx 20 items (log2 n) (1). Extremely fast/efficient (1).
4
Do not need exact log2 calculation (20), but must indicate "significantly fewer checks".
10
  • If the target item is at the start of the list (1).
  • Linear search finds it in 1 check, whereas Binary might take several divisions to reach it (1).
2
This tests understanding of "Best Case" scenarios.