Staircase search problem

How to sort 2D array?Is first sorting rows and after all the rows ,sorting all the columns?

In this question, the input 2d array will be given as sorted.Then you apply staircase search in O(n)
But in general, if you want to sort 2d array row wise and column wise, you can use the stl sort function for each row and then for each column

Sir,is this staircase search applicable only when this type sorted 2D array is given?or for any 2D array?

Yes it is applicable only when 2d array is sorted row wise and column wise

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.