Sorting algorithms

EasyMediumHard
12345678910111213141516171819202122
Question 19
Easy

An algorithm is represented by the following pseudo-code:

1  items[0] ← 45
2  items[1] ← 12
3  items[2] ← 89
4  items[3] ← 34
5  FOR i ← 0 TO 2
6      FOR j ← 0 TO 2
7          IF items[j] > items[j + 1] THEN
8              temp ← items[j]
9              items[j] ← items[j + 1]
10             items[j + 1] ← temp
11         ENDIF
12     ENDFOR
13 ENDFOR

State the purpose of this algorithm.

[1]

Sorting algorithms Questions

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