题目链接:https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/
题目如下:
class Solution {
public:
int findMin(vector<int>& nums) {
//二分法
int low=0,high=nums.size()-1,mid;
while(low<high){
mid=(low+high)>>1;
if(nums[high]<nums[mid]) low=mid+1;
else if(nums[high]>nums[mid]) high=mid;
else if(nums[high]==nums[mid]) high--;
}
return nums[low];
}
};