Selection Sort algorithm using an array