Initial upload

This commit is contained in:
2022-08-24 14:28:45 +02:00
parent c67653ddee
commit 57bc7b0289
370 changed files with 18479 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
function binarysearch(haystack, needle)
lo, hi = 1, length(haystack)
while lo <= hi
idx = Int(floor((hi + lo ) / 2))
if needle > haystack[idx]
lo = idx + 1
elseif needle < haystack[idx]
hi = idx - 1
else
return idx:idx
end
end
lo:hi
end