Sorting algorithms/Insertion sort: Difference between revisions

no edit summary
(added Yorick)
No edit summary
Line 704:
END IntSort;
END InsertSort.</lang>
 
=={{header|Objeck}}==
<lang objeck>
bundle Default {
class Insert {
function : Main(args : String[]) ~ Nil {
values := [9, 7, 10, 2, 9, 7, 4, 3, 10, 2, 7, 10];
InsertionSort(values);
each(i : values) {
values[i]->PrintLine();
};
}
function : InsertionSort (a : Int[]) ~ Nil {
each(i : a) {
value := a[i];
j := i - 1;
while(j >= 0 & a[j] > value) {
a[j + 1] := a[j];
j -= 1;
};
a[j + 1] := value;
};
}
}
}
</lang>
 
=={{header|OCaml}}==
760

edits