selectionSort(A, N): for i ← 0 to N-1: minj ← minimum(A, i, N) swap(A[i], A[minj])