Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
function countingSort(sequence array, integer mina, maxa)
|
||||
sequence count = repeat(0,maxa-mina+1)
|
||||
for i=1 to length(array) do
|
||||
count[array[i]-mina+1] += 1
|
||||
end for
|
||||
integer z = 1
|
||||
for i=mina to maxa do
|
||||
for j=1 to count[i-mina+1] do
|
||||
array[z] := i
|
||||
z += 1
|
||||
end for
|
||||
end for
|
||||
return array
|
||||
end function
|
||||
|
||||
sequence s = {5, 3, 1, 7, 4, 1, 1, 20}
|
||||
?countingSort(s,min(s),max(s))
|
||||
Loading…
Add table
Add a link
Reference in a new issue