for(i=0; i< n-1; i++) I smallIndex i; for (=i+1; j<n; j++) if (Af A[smallIndex) smallIndex =j: Swap(A[, AsmallIndex);for (i = 0; i < n-1; i++) { smallIndex = i; for (j = i+1; j < n; j++) if (A[j] < A[smallIndex]) smallIndex = j; Swap(A[i], A[smallIndex]); } }