void insertionSort(int n, keytype S[]) { index i, j; keytype x; for(i=1; i<n; i++){ x = S[i]; j = i - 1; while(j>=0 && S[j] > x) { S[j+1] = S[j]; j--; } S[j+1] = x; } }