Skip to content

Course home

Sorting algorithms

Sorting algorithms

EasyMediumHard
12345678910111213141516171819202122
Question 20

An algorithm is represented in the pseudocode below:

1  scores[0] ← 1240
2  scores[1] ← 8500
3  scores[2] ← 4320
4  scores[3] ← 9100
5  FOR i ← 0 TO 2
6      FOR j ← 0 TO 2
7          IF scores[j + 1] > scores[j] THEN
8              temp ← scores[j]
9              scores[j] ← scores[j + 1]
10             scores[j + 1] ← temp
11         ENDIF
12     ENDFOR
13 ENDFOR

State the purpose of this algorithm.

[1]
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