leetcode - Search in Rotated Sorted Array II
2013-11-05 22:48
429 查看
class Solution { public: bool search(int A[], int n, int target) { // IMPORTANT: Please reset any member data you declared, as // the same Solution instance will be reused for each test case. if (n<=0) // cannot decide which side target should be, so O(n) return -1; 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 Search in Rotated Sorted Array II
- [Leetcode] 81. Search in Rotated Sorted Array II 解题报告
- LeetCode Search in Rotated Sorted Array II
- 【leetcode】【81】Search in Rotated Sorted Array II
- Search in Rotated Sorted Array II leetcode java
- leetcode 7. 在有序可重复数组旋转后搜索 Search in Rotated Sorted Array II
- LeetCode -- Search in Rotated Sorted Array II
- Leetcode 81. Search in Rotated Sorted Array II 旋转数组查询2 解题报告
- LeetCode Search in Rotated Sorted Array II
- 【LeetCode】81. Search in Rotated Sorted Array II (2 solutions)
- leetcode 98: Search in Rotated Sorted Array II
- [Leetcode]Search in Rotated Sorted Array II
- [LeetCode] Search in Rotated Sorted Array II
- LeetCode : Search in Rotated Sorted Array II
- leetcode 【 Search in Rotated Sorted Array II 】python 实现
- leetcode -- Search in Rotated Sorted Array II
- [leetcode 81] Search in Rotated Sorted Array II
- LeetCode-81.Search in Rotated Sorted Array II