all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,11 @@
radixSortR =: 3 : 0 NB. base radixSort data
16 radixSortR y
:
keys =. x #.^:_1 y NB. compute keys
length =. #{.keys
extra =. (-length) {."0 buckets =. i.x
for_pass. i.-length do.
keys =. ; (buckets,pass{"1 keys) <@:}./.extra,keys
end.
x#.keys NB. restore the data
)

View file

@ -0,0 +1 @@
radixsort=: (] #~ [: +/ =/) i.@(>./)

View file

@ -0,0 +1,2 @@
radixsort ?.@#~10
4 5 6 6 6 6 6 8 8

View file

@ -0,0 +1 @@
rsort=: (] + radixsort@:-) <./

View file

@ -0,0 +1,2 @@
rsort _6+?.@#~10
_2 _1 0 0 0 0 0 2 2