0

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?

Zap
  • 325
  • 1
  • 6
  • 23
  • Are the rows and columns *sorted* or *strictly ascending*? – harold May 20 '17 at 16:31
  • The question says both. It confused me since it can be sorted without being ascending. I suppose having them ascending would match the indications above. So, not just sorted. – Zap May 20 '17 at 16:49
  • Ok let's go with that, it's more useful than merely sorted. – harold May 20 '17 at 16:56

0 Answers0