Sorting algorithms/Counting sort: Difference between revisions

Added PicoLisp
(→‎{{header|Perl 6}}: Added Perl 6 solution)
(Added PicoLisp)
Line 897:
}
?></lang>
 
=={{header|PicoLisp}}==
<lang PicoLisp>(de countingSort (Lst Min Max)
(let Count (need (- Max Min -1) NIL 0)
(for N Lst
(inc (nth Count (- N Min -1))) )
(make
(map
'((C I)
(do (car C) (link (car I))) )
Count
(range Min Max) ) ) ) )</lang>
Output:
 
<pre>: (countingSort (5 3 1 7 4 1 1 20) 1 20)
-> (1 1 1 3 4 5 7 20)</pre>
 
=={{header|PL/I}}==
Anonymous user