Anonymous user
Sorting algorithms/Counting sort: Difference between revisions
m
→version 1: added whitespace, changed comments and indentations.
m (Added Sidef language.) |
m (→version 1: added whitespace, changed comments and indentations.) |
||
Line 1,500:
=={{header|REXX}}==
===version 1===
<lang rexx>/*REXX program sorts an array using the count-sort
call gen@ /*generate the array elements. */
call show@ 'before sort'
call countSort
call show@ ' after sort'
exit /*stick a fork in it, we're done.*/
/*
countSort: procedure expose @.;
_.=0;
return
/*──────────────────────────────────GEN@ subroutine─────────────────────*/
gen@:
#=words($)
return
/*──────────────────────────────────SHOW@ subroutine────────────────────*/
show@: do s=1 for #
▲ end /*s*/
say copies('─',
return</lang>
'''output'''
Line 1,626 ⟶ 1,619:
────────────────────────────────────────
</pre>
===version 2===
{{trans|PL/I}}
|