Sorting algorithms/Counting sort: Difference between revisions

Content added Content deleted
No edit summary
Line 1,542: Line 1,542:
Sorted: 10 20 30 40 50 60 70 80
Sorted: 10 20 30 40 50 60 70 80
</pre>
</pre>

=={{header|Nanoquery}}==
{{trans|Java}}
<lang nanoquery>def countingSort(array, min, max)
count = {0} * (max - min + 1)

for number in array
count[number - min] += 1
end

z = 0
for i in range(min, max)
while count[i - min] > 0
array[z] = i
z += 1
count[i - min] -= 1;
end
end
end</lang>


=={{header|NetRexx}}==
=={{header|NetRexx}}==