标签:
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the array.
1 class Solution { 2 public: 3 bool search(vector<int>& nums, int target) { 4 if(nums.size()==0) return false; 5 6 for(int i=0;i<nums.size();i++) 7 { 8 if(target==nums[i]) 9 return true; 10 } 11 return false; 12 } 13 };
【leetcode】Search in Rotated Sorted Array II
标签:
原文地址:http://www.cnblogs.com/jawiezhu/p/4471743.html