Sorting algorithms/Insertion sort: Difference between revisions
Content deleted Content added
adding GAP |
Added PicoLisp |
||
Line 844: | Line 844: | ||
echo implode(',',$arr);</lang> |
echo implode(',',$arr);</lang> |
||
<pre>1,2,3,4,6,7,8,9</pre> |
<pre>1,2,3,4,6,7,8,9</pre> |
||
=={{header|PicoLisp}}== |
|||
<lang PicoLisp>(de insertionSort (Lst) |
|||
(for (I (cdr Lst) I (cdr I)) |
|||
(for (J Lst (n== J I) (cdr J)) |
|||
(T (> (car J) (car I)) |
|||
(rot J (offset I J)) ) ) ) |
|||
Lst )</lang> |
|||
Output: |
|||
<pre>: (insertionSort (5 3 1 7 4 1 1 20)) |
|||
-> (1 1 1 3 4 5 7 20)</pre> |
|||
=={{header|PL/I}}== |
=={{header|PL/I}}== |