Sorting algorithms

EasyMediumHard
12345678910111213141516171819202122
Question 12
Easy

An algorithm is represented in the pseudo-code below:

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

State the purpose of this algorithm.

[1]

Sorting algorithms Questions

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