Computer Science, asked by muthyalasreeja22, 6 months ago

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 singhanshuman1020
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