I'm trying to find an algorithm which, given two natural numbers n,m (m<=n), let A=[1,...n][1...m] whose elements are natural numbers. If we know that all A's elements are ascendingly sorted for each column and each row, meaning:
A[i,j] < A[i,j+1]
and
A[i,j] < A[i+1,j]
the algorithm needed should return the positions (X,Y) for which the value K is found. Additionally, I need to find it's complexity, but that can be calculated by its algorithm. Is this problem solved? Which algorithm would that be?