Implementation of Selection Sort-another O(n^2) algorithm