# 153. Find Minimum in Rotated Sorted Array　**

Suppose a sorted array is rotated at some pivot unknown to you beforehand.

(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).

Find the minimum element.

You may assume no duplicate exists in the array.

https://discuss.leetcode.com/topic/4100/compact-and-clean-c-solution/9

I have thought of this method, but got confused about the ending condition.

class Solution(object):
def findMin(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
low =0
high = len(nums)-1
while low < high:
if nums[low]<nums[high]:
return nums[low]
mid = (low+high)/2
if nums[mid]>= nums[low]:
low = mid +1
else:
high = mid
return nums[low]

#### [LeetCode]153.Find Minimum in Rotated Sorted Array

2015-01-31 17:21:26

#### LeetCode(153)Find Minimum in Rotated Sorted Array

2015-01-21 06:04:50

#### leetcode 153: Find Minimum in Rotated Sorted Array

2014-12-30 04:30:30

#### leetcode_c++： Find Minimum in Rotated Sorted Array （153）

2016-06-11 23:28:59

#### 【LeetCode-面试算法经典-Java实现】【153-Find Minimum in Rotated Sorted Array（找旋转数组中的最小数字）】

2015-08-21 06:24:18

#### Find Minimum in Rotated Sorted Array II -- LeetCode

2014-10-25 07:12:45

#### Find Minimum in Rotated Sorted Array -- LeetCode

2014-10-25 07:11:17

#### 153.Find Minimum in Rotated Sorted Array [LeetCode Java实现]

2015-03-19 19:03:14

#### 【LeetCode】Find Minimum in Rotated Sorted Array 解题报告

2014-10-20 10:33:26

#### LeetCode(154) Find Minimum in Rotated Sorted Array II

2015-01-21 09:10:48