Search Insert Position
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
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 阅读(68) 评论(0) 编辑 收藏 举报