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.
Practise AQA GCSE Computer Science Sorting algorithms with exam-style questions for GCSE Computer Science. 62 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.