Compact and clean C++ solution
Classic binary search problem. \n\nLooking at subarray with index [start,end]. We can find out that if the first member is less than the last member, there's no
Classic binary search problem. \n\nLooking at subarray with index [start,end]. We can find out that if the first member is less than the last member, there's no rotation in the array. So we could directly return the first element in this subarray.\n\nIf the first element is larger than the last one, then we compute the element in the middle, and compare it with the first element. If  value of the element in the middle is larger than the first element, we know the rotation is at the second half of this array. Else, it is in the first half in the array.\n \nWelcome to put your comments and suggestions.\n \n\n     int findMin(vector<int> &num) {\n            int start=0,end=num.size()-1;\n            \n            while (start<end) {\n                if (num[start]<num[end])\n                    return num[start];\n                \n                int mid = (start+end)/2;\n                \n                if (num[mid]>=num[start]) {\n                    start = mid+1;\n                } else {\n                    end = mid;\n                }\n            }\n            \n            return num[start];\n        }\n\nSome corner cases will be discussed  [here][1]\n\n\n \n\n\n  [1]: http://changhaz.wordpress.com/2014/10/15/leetcode-find-minimum-in-rotated-sorted-array/
[]