Given the MxN matrix, this O(MN)is what is optimal.
INIT rowMin = [ +Infinify ] xM
INIT colMax = [ -Infinity ] xN
FOR r = 1..M
FOR c = 1..N
rowMin[r] = MIN(rowMin[r], mat[r][c])
colMax[c] = MAX(colMax[c], mat[r][c])
FOR r = 1..M
FOR c = 1..N
IF mat[r][c] == rowMin[r] == colMax[c]
DECLARE saddlePoint(r, c)
Why is this optimal?
Because there are MxN values, and each of them must be viewed, therefore, for your answer, to be sure (that is, not probabilistic), the lower level O(MN).
?
. O(MN), , / , . O(M) (.. / min/max).
, O(MN) : .