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.
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue