The program to find the saddle point coordinates in a given matrix is discussed here. A saddle point is an element of the matrix, which is the minimum element in its row and the maximum in its column.
For example, consider the matrix given below
1 2 3
Mat[3][3] = 4 5 6
7 8 9
Here, 7 is the saddle point because it is the minimum element in its row and the maximum element in its column.
The program to find the saddle point coordinates in a given matrix is given below.
@@coding::1@@
Time complexity: O(n^2)
Recommended Programs