Java solution with binary search
The minimum element must satisfy one of two conditions: 1) If rotate, A[min] < A[min - 1]; 2) If not, A[0]. Therefore, we can use binary search: check the middl
The minimum element must satisfy one of two conditions: 1) If rotate, A[min] < A[min - 1]; 2) If not, A[0]. Therefore, we can use binary search: check the middle element, if it is less than previous one, then it is minimum. If not, there are 2 conditions as well: If it is greater than both left and right element, then minimum element should be on its right, otherwise on its left.\n\n    public class Solution {\n        public int findMin(int[] num) {\n            if (num == null || num.length == 0) {\n                return 0;\n            }\n            if (num.length == 1) {\n                return num[0];\n            }\n            int start = 0, end = num.length - 1;\n            while (start < end) {\n                int mid = (start + end) / 2;\n                if (mid > 0 && num[mid] < num[mid - 1]) {\n                    return num[mid];\n                }\n                if (num[start] <= num[mid] && num[mid] > num[end]) {\n                    start = mid + 1;\n                } else {\n                    end = mid - 1;\n                }\n            }\n            return num[start];\n        }\n    }
['Binary Tree', 'Java']