###### Search in Rotated Sorted Array
<pre name="code" class="cpp">class Solution{
public:
int search(vector<int>& nums,int target){
int first=0,end=nums.size();
int mid=0;
while(first<end){
mid=(first+end)/2;
if(nums[mid]==target)
return mid;
if(nums[mid]>=nums[first]){
if(target>=nums[first]&&target<nums[mid]){
end=mid;
}
else{
first=mid+1;
}

}
else{
if(target>nums[mid]&&target<=nums[end-1]){
first=mid+1;
}
else{
end=mid;
}
}

}
return -1;
}
};

#### 【LEETCODE】33-Search in Rotated Sorted Array [Python]

2016-01-22 11:26:41

#### Search in Rotated Sorted Array -- LeetCode

2014-03-05 09:15:45

#### Search in Rotated Sorted Array II -- LeetCode

2014-03-06 02:04:55

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

2014-10-25 17:00:36

#### LeetCode 33 — Search in Rotated Sorted Array（C++ Java Python）

2014-04-03 14:20:40

#### leetcode 81. Search in Rotated Sorted Array II-旋转数组|二分查找

2016-06-07 11:34:23

#### [LeetCode]81.Search in Rotated Sorted Array II

2014-01-15 22:29:05

#### [C++]LeetCode: 43 Search in Rotated Sorted Array

2014-12-11 21:54:40

#### LeetCode --- 81. Search in Rotated Sorted Array II

2015-04-03 17:03:46

#### LeetCode OJ:Search in Rotated Sorted Array II

2014-01-24 15:34:18

## 不良信息举报

Search in Rotated Sorted Array