//二分
int erfen(int arr[], int k){
int low=0, high=sizeof(arr)/sizef(int);
while(low<=high){
mid = (low+high)/2;
if( arr[mid]==k ) return mid;
if( arr[mid]>k ) high = mid-1;
else low = mid+1;
}
return 0;
}
1.2查找--二分
最新推荐文章于 2023-03-29 19:45:40 发布