-----QUESTION-----
Follow up for "Search in Rotated Sorted Array":
What if
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the array.
-----SOLUTION-----
class Solution {
public:
bool search(int A[], int n, int target) {
int i;
for (i = 0; i< n; i++)
{
if(A[i] == target) break;
}
if(i == n) return false;
return true;
}
};