Sorting algorithms/Insertion sort: Difference between revisions
Content added Content deleted
m (formatting of header material and adding cross-links) |
(added Ursala) |
||
Line 483: | Line 483: | ||
<pre> |
<pre> |
||
cat to.sort | selectionsort |
cat to.sort | selectionsort |
||
</pre> |
|||
=={{header|Ursala}}== |
|||
<lang Ursala> |
|||
#import nat |
|||
insort = ~&i&& @hNCtX ~&r->lx ^\~&rt nleq-~rlrSPrhlPrSCPTlrShlPNCTPQ@rhPlD |
|||
</lang> |
|||
test program: |
|||
<lang Ursala> |
|||
#cast %nL |
|||
example = insort <45,82,69,82,104,58,88,112,89,74> |
|||
</lang> |
|||
output: |
|||
<pre> |
|||
<45,58,69,74,82,82,88,89,104,112> |
|||
</pre> |
</pre> |