7Easy
0/1

Select the option that contains the false statement about the algorithm in Figure 1.

Figure 1

1  CONSTANT MAX_INDEX ← 3
2  arr ← [9, 4, 7, 2]
3  swapped ← true
4  WHILE swapped = true
5      swapped ← false
6      FOR i ← 0 TO MAX_INDEX - 1
7          IF arr[i] > arr[i+1] THEN
8              temp ← arr[i]
9              arr[i] ← arr[i+1]
10             arr[i+1] ← temp
11             swapped ← true
12         ENDIF
13     ENDFOR
14 ENDWHILE

The algorithm uses nested iteration.

The algorithm uses only definite iteration.

The algorithm uses a named constant.

The algorithm uses a temporary variable to swap elements.

Sorting algorithms Questions

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.

PreviousNext

Sorting algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Sorting algorithms