All pastes #2073306 Raw Edit

Someone

public text v1 · immutable
#2073306 ·published 2011-06-01 17:18 UTC
rendered paste body
I 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).