[Leetcode] 81. Search in Rotated Sorted Array II
2015-03-31 10:42
309 查看
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.
public class Solution { public boolean search(int[] A, int target) { if(A == null || A.length == 0) return false; for(int i = 0; i < A.length; i++){ if(A[i] == target) return true; } return false; } }
相关文章推荐
- LeetCode --- 81. Search in Rotated Sorted Array II
- LeetCode 81. Search in Rotated Sorted Array II
- LeetCode(33)(81) Search in Rotated Sorted Array I II
- 【LeetCode】81. Search in Rotated Sorted Array II (2 solutions)
- [LeetCode] Search in Rotated Sorted Array I (33) && II (81) 解题思路
- 81. Search in Rotated Sorted Array II Leetcode Python
- Leetcode 81. Search in Rotated Sorted Array II
- Leetcode 81. Search in Rotated Sorted Array II
- [Leetcode 81, Medium] Search in Rotated Sorted Array II
- LeetCode 81 Search in Rotated Sorted Array II
- leetcode[81]Search in Rotated Sorted Array II
- [leetcode-81]Search in Rotated Sorted Array II(C)
- leetcode 81 :Search in Rotated Sorted Array II
- [leetcode]@python 81. Search in Rotated Sorted Array II
- [LeetCode]81 Search in Rotated Sorted Array II
- !leetcode[33&81]:Search in Rotated Sorted Array[I & II]
- [leetcode] 81.Search in Rotated Sorted Array II
- leetcode 81: Search in Rotated Sorted Array II
- leetCode 81.Search in Rotated Sorted Array II (旋转数组的搜索II) 解题思路和方法
- LeetCode81——Search in Rotated Sorted Array II