Sorting algorithms/Counting sort: Difference between revisions

Content added Content deleted
(GP)
Line 858: Line 858:
in
in
{Show {CountingSort [3 1 4 1 5 9 2 6 5]}}</lang>
{Show {CountingSort [3 1 4 1 5 9 2 6 5]}}</lang>

=={{header|PARI/GP}}==
<lang parigp>countingSort(v,mn,mx)={
my(u=vector(#v),i=0);
for(n=mn,mx,
for(j=1,#v,if(v[j]==n,u[i++]=n))
);
u
};</lang>


=={{header|Pascal}}==
=={{header|Pascal}}==