Anonymous user
Sorting algorithms/Insertion sort: Difference between revisions
→{{header|Javascript}}: An insertion sort should have the property that nearly sorted lists sort in linear time and the splice method didnt work that way.
(→{{header|Perl}}: Use a range instead of a for loop on $i) |
(→{{header|Javascript}}: An insertion sort should have the property that nearly sorted lists sort in linear time and the splice method didnt work that way.) |
||
Line 656:
function insertionSort (a) {
for (var i = 0; i < a.length; i++) {
for (var j =
}
return a;
|