Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -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
|
||||
)
|
||||
|
|
@ -0,0 +1 @@
|
|||
radixsort=: (] #~ [: +/ =/) i.@(>./)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
radixsort ?.@#~10
|
||||
4 5 6 6 6 6 6 8 8
|
||||
|
|
@ -0,0 +1 @@
|
|||
rsort=: (] + radixsort@:-) <./
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
rsort _6+?.@#~10
|
||||
_2 _1 0 0 0 0 0 2 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue