@@ -0,0 +1,915 @@
+/**%0A *%09Suppose a sorted array is rotated at some pivot unknown to you beforehand.%0A *%0A *%09(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).%0A *%0A *%09Find the minimum element.%0A *%0A *%09You may assume no duplicate exists in the array.%0A *%09%0A *%09Author: matao%0A */%0A%0Apublic class FindMinimumInRotatedSortedArray %7B%0A%09public static int findMin(int%5B%5D nums) %7B%0A%09%09int start = 0, end = nums.length - 1;%0A%09%09while(start + 1 %3C end) %7B%0A%09%09%09int mid = start + (end - start) / 2;%0A%09%09%09if(nums%5Bmid%5D %3E= nums%5Bend%5D)%0A                start = mid;%0A            else%0A                end = mid;%0A%09%09%7D%0A%09%09if(nums%5Bstart%5D %3C nums%5Bend%5D)%0A            return nums%5Bstart%5D;%0A        else%0A            return nums%5Bend%5D;%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09int%5B%5D nums1 = %7B2, 3, 1%7D;%0A%09%09int%5B%5D nums2 = %7B4, 5, 6, 7, 0, 1, 2%7D;%0A%09%09int%5B%5D nums3 = %7B1, 2, 3%7D;%0A%09%09System.out.println(findMin(nums1));%0A%09%09System.out.println(findMin(nums2));%0A%09%09System.out.println(findMin(nums3));%0A%09%7D%0A%7D

add Find Minimum in Rotated Sorted Array solution