Sorting algorithms/Counting sort: Difference between revisions

m
→‎version 1: removed the need for the I DO loop, the finding of the MIN and MAX was incorporated into the J DO loop.
m (→‎{{header|REXX}}: added another comment to the REXX section header about what kinds of integers are supported.)
m (→‎version 1: removed the need for the I DO loop, the finding of the MIN and MAX was incorporated into the J DO loop.)
Line 1,758:
/*──────────────────────────────────COUNTSORT subroutine────────────────*/
countSort: procedure expose @.; parse arg N; L=@.1; h=L; _.=0; x=1
do ij=21 to for N; z=@.j; _.z=_.z+1; L=min(L,@.ij); h=max(h,@.ij); end /*ij*/
do k=L to h; do jx=1 x for N_.k; z=@.jx=k; end /*x*/; _.z=_.z+1; end /*jk*/
do k=L to h; do x=x for _.k; @.x=k; end /*x*/; end /*k*/
return
/*──────────────────────────────────SHOW@ subroutine────────────────────*/