W
willamette3597
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 ?
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 ?