int searchInsert(int* nums, int numsSize, int target) { int low=0; if(numsSize<=0)return 0; int high=numsSize-1; int mid; while(low<=high){ mid=(low+high)/2; if(nums[mid]>=target)high=mid-1; else low=mid+1; } return low; }
int searchInsert(int* nums, int numsSize, int target) { int low=0; if(numsSize<=0)return 0; int high=numsSize-1; int mid; while(low<=high){ mid=(low+high)/2; if(nums[mid]>=target)high=mid-1; else low=mid+1; } return low; }