Re: Binary Search



>>Could Someone tell me Where can I get The result though the Binary
>>Search
>>eg.
>>max , min , mid ,want;
>>While ( max > min )
>>{
>>mid = (min + max )/2 ;
>>if ( mid > want ) max = mid + 1;
>>else min = mid -1 ;
>>Line1 :
>>}

>>Line2 :
>>Where can I get the correct result ? Line1 or Line2 ?

The best way to answer these questions is to take a sample ( an array
and a key in this case ), and then run through your algorithm/code for
both positive and negative cases.

.