class Solution { public: int minNumberInRotateArray(vector<int> rotateArray) { if(rotateArray.size()==0)return 0; int low=0,high=rotateArray.size()-1,mid; while(low<high){ if(rotateArray[low]<rotateArray[high])return rotateArray[low];//当要查找的数组这样必然递增,直接返回值 mid = low+(high-low>>1); if(rotateArray[mid] > rotateArray[low])low=mid+1;//前半个部分为递增数组。从后半个部分找low=mid+1 else if(rotateArray[mid] < rotateArray[high])high=mid;//后半个部分递增,则结果在前半个部分high=mid else low++;//相等时,无法确定最小值在那一块,只能一步一步找。 } return rotateArray[low]; } };