二分查找https://leetcode-cn.com/problems/binary-search/
双指针二分查找
int search(int* nums, int numsSize, int target){
int i , left = 0, right = numsSize - 1;
while(left <= right){
int mid = (left + right)>>1; //每次循环更新mid
if(nums[mid] == target){
return mid;
}else if(nums[mid] < target){
left = mid+1;
}else if(nums[mid] > target){
right = mid-1;
}
}
return -1;
}