Open
Description
Description of the problem
- Implement Staircase Search Algorithm.
- Used to search an element from a row-wise and column-wise sorted 2-D array.
- Time Complexity: O(max(n, m)), where n=number of rows, m= number of columns
- Space Complexity: O(1)
Example of the Problem
Dimensions of the array: 5 5
Element to be searched: 20
1 4 8 10 45
2 5 9 15 55
6 16 18 20 12
7 14 21 27 11
11 17 19 23 19
Output:
20 found at (2,3)