Search in a Sorted Matrix

Search in a row wise and column wise sorted matrix

Given an n x n matrix, where every row and column is sorted in increasing order. Given a number x, how to decide whether this x is in the matrix. The designed algorithm should have linear time complexity.

Author: vishal3096
Login to Answer
Sort By:
My Answer