A list of numbers needs to be sorted into ascending order.
Identify the sorting algorithm that compares each item with the item next to it and swaps them if they are in the wrong order.
Mark scheme
- B Bubble sort (1)
- The only correct answer is B. The correct answer is bubble sort.
- A is not correct because a binary search is a search algorithm that halves a sorted list
- C is not correct because a linear search checks each item in turn
- D is not correct because a merge sort splits the list into sub-lists and merges them back together
Example answers and how they were marked
B Bubble sort
Why: Correct option (1): a bubble sort compares each item with the one next to it and swaps them.
D Merge sort
Why: Near miss: merge sort also sorts, but it splits the list into sub-lists and merges them, so it does not compare each item with the item next to it.
A Binary search
Why: Confuses a search algorithm with a sort algorithm: a binary search halves a sorted list to find an item.