剑指offer上的题目,旋转数组的最小值
利用二分查找的思想,但是和二分查找又有不同
<span style="font-family:Microsoft YaHei;font-size:14px;">int findMin(int num[], int n) {
int low = 0,high = n-1;
while(low < high){
if(num[low] < num[high]) return num[low];
int mid = (low+high)/2;
if(num[mid] >= num[low]) low = mid+1;
else if(num[mid] < num[high]) high = mid;
}
return num[low];
}</span>