User interface language: English | Español

Date November 2021 Marks available 2 Reference code 21N.1.HL.TZ0.3
Level HL Paper 1 Time zone no time zone
Command term Outline Question number 3 Adapted from N/A

Question

Outline what is meant by a sorting algorithm.

[2]
a.

Outline one difference between a bubble sort algorithm and a selection sort algorithm.

[2]
b.

Markscheme

Award [2 max] 
A sorting algorithm is a method for reorganizing a number of items;
into a specific order (such as alphabetical order, highest-to-lowest value);

Sorting algorithm performs specific operations on the input list/array;
In order to deliver ordered list/array as output;

a.

Award [2 max] 

Bubble sort swaps adjacent items;
Selection sort finds the next smallest (each time it goes through the list);

Bubble sort can exit early/ is faster if already the list is sorted;
Selection sort will need to complete the procedure for the entire list every time;

(The efficiency of Bubble and selection sort is different when applied on already sorted list)
in the best-case bubble sort takes an order of N time;
whereas selection sort consumes an order of N2 time (where N is the number of items on the list));

Note: To award marks for such an answer it should be evident that the list is already sorted OR the term 'the best-case' should appear because the worst-case /average-case complexity/efficiency is same in both algorithms (O(N2)).

b.

Examiners report

In this question both parts, (a) and (b), were well answered by the majority of candidates. Many candidates scored full or nearly full marks for this question.

a.

In this question both parts, (a) and (b), were well answered by the majority of candidates. A few candidates confused Bubble Sort with Selection Sort. Many candidates scored full or nearly full marks for this question.

b.

Syllabus sections

Topic 4: Computational thinking, problem-solving and programming » 4.2 Connecting computational thinking and program design
Show 59 related questions
Topic 4: Computational thinking, problem-solving and programming

View options