Search Insert Position
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; }
posted on 2016-12-09 20:37 lichao_normal 阅读(70) 评论(0) 收藏 举报
浙公网安备 33010602011771号