int binarysort(int begin , int end , int target)
{
if ( begin >end ) return -1 ;
int middle = (begin + end ) >>1;
if ( arr[middle ] == target ) return middle;
else
if ( target > arr[middle])
binarysort( middle +1 , end, target);
else
binarysort(begin , middle -1 , target);
}
int binarysort(int begin , int end , int target)
{
int middle ;
while ( begin <= end )
{
middle = (begin + end)>>1;
if ( arr[middle] == target)
return middle;
if ( target > arr[middle])
begin = middle +1;
else
end = middle -1 ;
}
return -1;
}