An algorithm is shown below.
1 readings ← [3.8, 1.2, 4.5, 0.9, 2.7]
2 n ← 5
3 FOR pass ← 0 TO n - 2
4 FOR idx ← 0 TO n - pass - 2
5 IF readings[idx] > readings[idx+1] THEN
6 temp ← readings[idx]
7 readings[idx] ← readings[idx+1]
8 readings[idx+1] ← temp
9 ENDIF
10 ENDFOR
11 ENDFOR
Which of the following contains the false statement about the algorithm?
The algorithm uses only nested definite iteration.
The algorithm sorts the list in ascending numerical order.
The value of readings[4] after the first complete pass of the outer loop (pass = 0) is 4.54.54.5.
The total number of comparisons made during the execution of the algorithm is 15.
52 exam-style questions on AQA GCSE Computer Science Sorting algorithms. Each one has a worked solution and a mark scheme showing where the marks go.