Someone
public text v1 · immutableI have the following two dimensional array, like the example below ([0][0] = 1, [0][1] = 8, [1][1] = 60). Note that this is just an example. The array is of size n x n, and the values of a[x][random] are always smaller than a[x+1/2/3.../n][other random cell], just like in the example below.
1 8 2
9 1,023 60
1,394 5,412 1,024
I need to write a search code that will go through the array and return true if a certain number is there, and false if it isn't. It has to be O(n).