Here is nice and simple soln
start with top right element
loop:
compare this element(e) with m
i) if they are equal then return its position
ii) e<m then move it to down (if outof bound of matrix then break return false)
ii) e>m then move it to left (if outof bound of matrix then break return false)
repeat the "loop" till u find element or returned false
This will work for M*N matrix(not only for N*N)
Order would be O(M+N), for above case it will be O(2N)