LeetCode-Search in Rotated Sorted Array II
2013-09-17 15:54
176 查看
Follow up for "Search in Rotated Sorted Array":
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.
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.
class Solution { public: bool search(int A[], int n, int target) { if(n==0)return false; for(int i=0;i<n;i++){ if(A[i]==target)return true; } return false; } };
相关文章推荐
- [leetcode]Search in Rotated Sorted Array II
- leetcode -- Search in Rotated Sorted Array II
- [leetcode 81] Search in Rotated Sorted Array II
- [LeetCode] 81. Search in Rotated Sorted Array II
- 【LeetCode】-Search in Rotated Sorted Array II
- leetcode - Search in Rotated Sorted Array II
- LeetCode刷题【Array】 Search in Rotated Sorted Array II
- [Leetcode]Search in Rotated Sorted Array II
- LeetCode-Search in Rotated Sorted Array II
- leetcode 81. Search in Rotated Sorted Array II
- LeetCode *** 81. Search in Rotated Sorted Array II
- leetcode 98: Search in Rotated Sorted Array II
- [C++]LeetCode: 44 Search in Rotated Sorted Array II
- [leetcode]81. Search in Rotated Sorted Array II
- LeetCode 之 Search in Rotated Sorted Array I II — C/C++ 实现
- [leetcode] Search in Rotated Sorted Array II
- Search in Rotated Sorted Array II--LeetCode
- LeetCode | 81. Search in Rotated Sorted Array II
- Leetcode Search in Rotated Sorted Array I && II
- leetcode_middle_86_81. Search in Rotated Sorted Array II