bool linearsearch(int A[], int N, int X) { for (int i=0; i<N; i++) if (A[i] == X) return true; return false; }