Sorting algorithms/Insertion sort: Difference between revisions
Content added Content deleted
(→{{header|MATLAB}}: works fine with Octave, too. Verified with Octave 3.4.3) |
|||
Line 916: | Line 916: | ||
print(unpack(isort{4,5,2,7,8,3}))</lang> |
print(unpack(isort{4,5,2,7,8,3}))</lang> |
||
=={{header|MATLAB}}== |
=={{header|MATLAB}} / {{header|Octave}}== |
||
This is a direct translation of the pseudo-code above, except that it has been modified to compensate for MATLAB's 1 based arrays. |
This is a direct translation of the pseudo-code above, except that it has been modified to compensate for MATLAB's 1 based arrays. |
||
<lang MATLAB>function list = insertionSort(list) |
<lang MATLAB>function list = insertionSort(list) |
||
Line 941: | Line 941: | ||
1 2 3 4 5 6</lang> |
1 2 3 4 5 6</lang> |
||
=={{header|Modula-3}}== |
=={{header|Modula-3}}== |