fix some file extensions

This commit is contained in:
Ingy döt Net 2013-04-11 11:14:19 -07:00
parent 68f8f3e56b
commit f3a896c724
789 changed files with 91 additions and 62 deletions

View file

@ -0,0 +1,30 @@
fn binarySearchRecursive arr value lower upper =
(
if lower == upper then
(
if arr[lower] == value then
(
return lower
)
else
(
return -1
)
)
mid = (lower + upper) / 2
if arr[mid] > value then
(
return binarySearchRecursive arr value lower (mid-1)
)
else if arr[mid] < value then
(
return binarySearchRecursive arr value (mid+1) upper
)
else
(
return mid
)
)
arr = #(1, 3, 4, 5, 6, 7, 8, 9, 10)
result = binarySearchRecursive arr 6 1 arr.count