题解 | #二分查找-II#
二分查找-II
http://www.nowcoder.com/practice/4f470d1d3b734f8aaf2afb014185b395
左下标left,右下标right,mid=left+(right-left)/2;if(nums[mid]==target)则继续向左边找到最小下标,if(nums[mid]<target)left=mid+1;if(nums[mid]>target)right=mid-1;
二分查找-II
http://www.nowcoder.com/practice/4f470d1d3b734f8aaf2afb014185b395
左下标left,右下标right,mid=left+(right-left)/2;if(nums[mid]==target)则继续向左边找到最小下标,if(nums[mid]<target)left=mid+1;if(nums[mid]>target)right=mid-1;
相关推荐