Jump to content

Sorting algorithms/Counting sort: Difference between revisions

Updated to work with version 1.4 of Nim.
(Added Wren)
(Updated to work with version 1.4 of Nim.)
Line 2,189:
var z = 0
 
for i in 0 .. < a.len: inc count[a[i] - min]
 
for i in min .. max:
for j in 0 ..< <count[i - min]:
a[z] = i
inc z
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.