We have given the m*n matrix and in which we have to search the target element. In this we can search via row or column.