Assume below that when the method is called, n is the number of rows; and m is the number of columns.
public static boolean search(double[] data, int n, int m, double target) {
int i; // for the row index
int j; //for the column index
for (i = 0; i < n; i++) {
for (j = 0; j < m;j++) {
if (a[i][j] == target){
return true;
}
}
}
return false;
}