Jump to content

Sorting algorithms/Counting sort: Difference between revisions

GP
(GP)
Line 858:
in
{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}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.