Selection Sort implementation.