Date | November 2020 | Marks available | 4 | Reference code | 20N.1.SL.TZ0.5 |
Level | SL | Paper | 1 | Time zone | no time zone |
Command term | Describe | Question number | 5 | Adapted from | N/A |
Question
Describe the steps involved in using the bubble sort algorithm to sort an array.
Markscheme
Award [4 max].
Award [1] for looping through array;
Award [1] for comparing each pair of adjacent items (in the array);
Award [1] for swapping them if they are in the wrong order;
Award [1] for repeating this until no swaps is required (which indicates that the array is sorted);
Examiners report
Candidates were required to write the main steps involved in a bubble sort algorithm. Candidates who wrote their answer in algorithmic form achieved better results than those who simply described the process. The full range of marks, from zero to four were achieved for this question. Some candidates lost out because they described a different sort routine than the bubble sort required in the question. Other candidates were able to demonstrate well how the bubble sort operated for one pass of the algorithm but forgot to mention that it would repeat until no swaps had been required.