Skip to content

Course home

Sorting algorithms

Sorting algorithms

EasyMediumHard
12345678910111213141516171819202122
Question 4

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
A

The algorithm uses nested iteration.

B

The algorithm uses only definite iteration.

C

The algorithm uses a named constant.

D

The algorithm uses a temporary variable to swap elements.

Markscheme

Sorting algorithms Questions

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

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.

Question bank