/* * 153. Find Minimum in Rotated Sorted Array * 2016-6-1 by Mingyang * 只用跟end比较就行了 */ public int findMin(int[] nums) { int start = 0; int end = nums.length - 1; int mid = 0; while(start < end) { mid = start + (end - start) / 2; if (nums[mid] > nums[end]) { start = mid + 1; } else if (nums[mid] < nums[end]) { end = mid; } } return nums[start]; }