Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Quickselect-algorithm/J/quickselect-algorithm-1.j
Normal file
14
Task/Quickselect-algorithm/J/quickselect-algorithm-1.j
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
quickselect=:4 :0
|
||||
if. 0=#y do. _ return. end.
|
||||
n=.?#y
|
||||
m=.n{y
|
||||
if. x < m do.
|
||||
x quickselect (m>y)#y
|
||||
else.
|
||||
if. x > m do.
|
||||
x quickselect (m<y)#y
|
||||
else.
|
||||
m
|
||||
end.
|
||||
end.
|
||||
)
|
||||
2
Task/Quickselect-algorithm/J/quickselect-algorithm-2.j
Normal file
2
Task/Quickselect-algorithm/J/quickselect-algorithm-2.j
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
8 quickselect 9, 8, 7, 6, 5, 0, 1, 2, 3, 4
|
||||
8
|
||||
2
Task/Quickselect-algorithm/J/quickselect-algorithm-3.j
Normal file
2
Task/Quickselect-algorithm/J/quickselect-algorithm-3.j
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((10 {./:~) quickselect"0 1 ]) 9, 8, 7, 6, 5, 0, 1, 2, 3, 4
|
||||
0 1 2 3 4 5 6 7 8 9
|
||||
Loading…
Add table
Add a link
Reference in a new issue