63. Search in Rotated Sorted Arr
作者:
博瑜 | 来源:发表于
2017-07-12 08:26 被阅读0次public class Solution {
/**
* param A : an integer ratated sorted array and duplicates are allowed
* param target : an integer to be search
* return : a boolean
*/
public boolean search(int[] A, int target) {
// write your code here
if (A == null) return false;
int length = A.length;
for (int i = 0; i < length; i++) {
if (A[i] == target) return true;
}
return false;
}
}
本文标题:63. Search in Rotated Sorted Arr
本文链接:https://www.haomeiwen.com/subject/lobvhxtx.html
网友评论