303 11/16/2016 8:04:19 AM


:

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

:

Permutation of numbers

:

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

:
  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
:

Space: O(1)

:

O(n2)