c++ best linear search algorithm code example
Example: linear search in c++
bool linearsearch(int A[], int N, int X) {
for (int i=0; i<N; i++)
if (A[i] == X) return true;
return false;
}
bool linearsearch(int A[], int N, int X) {
for (int i=0; i<N; i++)
if (A[i] == X) return true;
return false;
}