Binary Search | O(log n) runtime & O(1) space
\nclass Solution {\n      /**\n       * find the pivot in the sorted array. Find the middle index of the array. We can compare the\n       * middle index elemen
```\nclass Solution {\n      /**\n       * find the pivot in the sorted array. Find the middle index of the array. We can compare the\n       * middle index element with either the previous element and next element and see if the pivot is\n       * present there. If mid is greater than next, mid is the pivot. If the prev is greater than mid,\n       * prev is the pivot.\n       * <p>\n       * If both cases are failed, the pivot will either be in the left half or the right half. Compare\n       * the leftmost element in the partition with the mid-element. If mid is greater, the first half\n       * is in ascending order and the pivot will be in the latter half. So, ignore the first and\n       * consider just the latter half. Else, vice versa\n       */\n    public int findMin(int[] nums) {\n        int pivot = findPivot(nums, 0, nums.length - 1);\n        return pivot == -1 ? nums[0] : nums[pivot + 1];\n    }\n    \n    private int findPivot(int[] nums, int left, int right) {\n        if (left > right) return -1;\n        int mid = (left + right) / 2;\n        if (mid < right && nums[mid] > nums[mid + 1])\n            return mid;\n        else if (mid > left && nums[mid - 1] > nums[mid])\n            return mid - 1;\n        \n        if (nums[left] > nums[mid])\n            return findPivot(nums, left, mid - 1);\n        else\n            return findPivot(nums, mid + 1, right);\n    }\n}\n```
['Binary Tree', 'Java']