参考java
https://blog.csdn.net/YF_Li123/article/details/70548302
https://blog.csdn.net/weixin_40271182/article/details/84615481
class Solution {
public:
int minNumberInRotateArray(vector<int> rotateArray) {
int low = 0;
int high = rotateArray.size()-1;
while(low<high){
int mid = (low+high)/2;
if(rotateArray[mid]>rotateArray[high])
low = mid +1;
else if(rotateArray[mid]==rotateArray[high]){
low = low - 1;
high = high - 1;
}
else
high = mid;
}
return rotateArray[low];
}
};
---------------------
作者:潭溪熹子
来源:CSDN
原文:https://blog.csdn.net/weixin_40271182/article/details/84615481
版权声明:本文为博主原创文章,转载请附上博文链接!