Algorithm Pseudocode:
SelectionSort(A[0..n-1])
 for i=0 to n-2 do
 min=i
  for j=i+1 to n-1 do
   if A[j] < A[min]
    min=j
   swap A[i] with A[min]

Selection Sort is a comparison sorting algorithm which repeatedly finds the minimum element in the unsorted part of the array and moves it to the sorted part.

The minimum element is selected from the right side and exchanged with the leftmost element of the right side. The process continues and moves one place to the right.