Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -1 +1 @@
|
|||
quicksort:{f:*x@1?#x;:[0=#x;x;,/(_f x@&x<f;x@&x=f;_f x@&x>f)]}
|
||||
qsort:{$[2>#?x;x;,/o'x@&'~:\x<*1?x]}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
quicksort 1 3 5 7 9 8 6 4 2
|
||||
quicksort:{p:*x[1?#x];:[0=#x;x;,/(_f x[&x<p];x[&x=p];_f x[&x>p])]}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
_f()
|
||||
quicksort 1 3 5 7 9 8 6 4 2
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
:[....]
|
||||
_f
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
f:*x@1?#x
|
||||
:[....]
|
||||
|
|
|
|||
|
|
@ -1,9 +1 @@
|
|||
:[
|
||||
0=#x; / if length of x is zero
|
||||
x; / then return x
|
||||
/ else
|
||||
,/( / join the results of:
|
||||
_f x@&x<f / sort (recursively) elements less than f (pivot)
|
||||
x@&x=f / element equal to f
|
||||
_f x@&x>f) / sort (recursively) elements greater than f
|
||||
]
|
||||
p:*x[1?#x]
|
||||
|
|
|
|||
|
|
@ -1 +1,9 @@
|
|||
t@<t:1 3 5 7 9 8 6 4 2
|
||||
:[
|
||||
0=#x; / if length of x is zero
|
||||
x; / then return x
|
||||
/ else
|
||||
,/( / join the results of:
|
||||
_f x[&x<p] / sort (recursively) elements less than pivot p
|
||||
x[&x=p] / elements equal to p
|
||||
_f x[&x>p]) / sort (recursively) elements greater than p
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
t@<t:1 3 5 7 9 8 6 4 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue