Sorting algorithms/Insertion sort: Difference between revisions

→‎{{header|C}}: Keep indexing the same as the shell sort
(→‎{{header|Perl}}: Rather not use a statement label if I can help it)
(→‎{{header|C}}: Keep indexing the same as the shell sort)
Line 195:
for (i = 1; i < n; i++) {
k = a[i];
for (j = i - 1; j >= 0 && k < a[j - 1]; j--) {
a[j + 1] = a[j - 1];
}
a[j + 1] = k;
}
}
Anonymous user