Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Binary-search/BASIC256/binary-search-1.basic
Normal file
10
Task/Binary-search/BASIC256/binary-search-1.basic
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
function binarySearchR(array, valor, lb, ub)
|
||||
if ub < lb then
|
||||
return false
|
||||
else
|
||||
mitad = floor((lb + ub) / 2)
|
||||
if valor < array[mitad] then return binarySearchR(array, valor, lb, mitad-1)
|
||||
if valor > array[mitad] then return binarySearchR(array, valor, mitad+1, ub)
|
||||
if valor = array[mitad] then return mitad
|
||||
end if
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue