|
function binarySearchI(array, valor)
|
|
lb = array[?,]
|
|
ub = array[?]
|
|
|
|
while lb <= ub
|
|
mitad = floor((lb + ub) / 2)
|
|
begin case
|
|
case array[mitad] > valor
|
|
ub = mitad - 1
|
|
case array[mitad] < valor
|
|
lb = mitad + 1
|
|
else
|
|
return mitad
|
|
end case
|
|
end while
|
|
return false
|
|
end function
|