function MyBinarySearch(array arr, integer low, integer high, integer item)
{
if ( low > high )
{
return -1
3
integer mid = (low + high)/2
if ( arr[mid] equals item)
{
return mid
3
else if ( arr[mid] > item)
{
return //missing statement 1
>
else
{
return //missing statement 2
Answers
Answered by
19
Answer:
function MyBinarySearch(array arr, integer low, integer high, integer item)
{
if ( low > high )
{
return -1
3
integer mid = (low + high)/2
if ( arr[mid] equals item)
{
return mid
3
else if ( arr[mid] > item)
{
return MyBinarySearch(arr, mid +1, high, item)
>
else
{
return MyBinarySearch(arr, low, mid - 1, item)
Similar questions
Math,
2 months ago
English,
2 months ago
Computer Science,
6 months ago
English,
11 months ago
English,
11 months ago