seletion sort in scala