90.4k views
4 votes
The input is an N by N matrix of numbers that is already in memory. Each individual row is increasing from left to right. Each individual column is increasing from top to bottom. Give an O(N) worst-case algorithm that decides if a number X is in the matrix.

User Micfan
by
7.2k points

1 Answer

4 votes

Answer:

note:

solution is attached please find the attachment

The input is an N by N matrix of numbers that is already in memory. Each individual-example-1
The input is an N by N matrix of numbers that is already in memory. Each individual-example-2
User Red Mercury
by
7.0k points