I illustrate it below:

1,2,3,4,5,6,7,8,9

First Binary Search Algo:

Binary Search(a,x)

{

do{

mid=floor(beg+end/2);

if(a[mid]==x)

return TRUE

else if(x>a[mid])

lo=mid+1

else

hi=mid-1

}while(beg<=end)

}

Considering array indices startted at 1 and went to 9

lo=1

hi=9

mid=floor(1+9/2)=5 @ f(5) !=0 Fail

lo=1

hi=4 (its pritty intuitive why i chose lower half!)

mid=floor(1+4/2)=2 @ f(2)=0 <----tada!!! we have got it

SO just 2 is the answer

THE QUESTION MUST BE DONE THIS WAY IF WE ARE USING BINARY SEARCH I FEEL IF ANY BODY HAS A DFFERENT OPINION THEN PLZ LET ME KNOW