Anonymous user
Sorting algorithms/Insertion sort: Difference between revisions
Sorting algorithms/Insertion sort (view source)
Revision as of 14:48, 31 January 2012
, 12 years ago→{{header|Mathematica}}
Line 917:
=={{header|Mathematica}}==
<lang Mathematica>insertionSort[
For[
value = A[[i]]; j = i - 1;
While[
A[[j + 1]] = value;];
A
<pre>insertionSort@{ 2, 1, 3, 5}
{1, 2, 3, 5}</pre>
=={{header|MATLAB}} / {{header|Octave}}==
|