Finding a saddle point in a 2-d array

To find a saddle point in a 2-d array or a matrix follow the given procedure -

a) Find the min value in each row of the matrix.

b) Store the row no. of the value which is the greatest in the min values found in a) above. Call this value max-min.

c) Find the max value in each column of the matrix.

d) Store the column no. of the value which is the minimum in the values found above in c). Call this value min-max.

e) If the two values max-min and min-max are equal then the saddle point exists and it’s location is the stored row no. and column no. If the two values are not equal then the saddle point doesn’t exist. Also note that there can be more than one saddle point but the values at those points will all be equal.