Input:

Sequence <A1', A2', ...An'> of numbers

Output:

Permutation of numbers

Pseudocode:

Permutation of numbers <A1',A2',...An'>

Description:
  1. Find first smallest element in array and move it to 1st position
  2. Find second smallest element and move it to 2nd position
  3. ...
  4. Repeat same until array is sorted
Running Time:

Space: O(1)

Worst Case:

O(n2)

Average Case:

O(n2)