Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -1,19 +0,0 @@
defmodule Quick do
def select(k, [x|xs]) do
{ys, zs} = Enum.partition(xs, fn e -> e < x end)
l = length(ys)
cond do
k < l -> select(k, ys)
k > l -> select(k - l - 1, zs)
true -> x
end
end
def test do
v = [9, 8, 7, 6, 5, 0, 1, 2, 3, 4]
Enum.map(0..length(v)-1, fn i -> select(i,v) end)
|> IO.inspect
end
end
Quick.test