CSC 7000-002 Algorithms & Programming
Fall 1999, Mendel 115
Dr. David Matuszek
In game theory, a saddle point in a numerical array is a number that is larger than or equal to every number in its column, and smaller than or equal to every number in its row.
First, read in the following array:
|
Next, find the minimum in each row, and find the maximum in each column, and put these in separate arrays. Hint: you will need two loops for each array, one to loop over the rows [columns], and an inside loop to find the minimum [maximum] value in each row [column]. Print out these two arrays, each on a single line (don't try to do anything fancy with the output).
|
|
||||||||||||||||||
|
Finally, find and print the minimum value of the column maxima (-10), and the maximum value of the row minima (also -10). If these are equal, print that you have a saddle point, and give the row and column number in which it occurs. If these two numbers are unequal, print a message saying that there is no saddle point.
Purpose of this assignment:
for loops. Notes:
#define statements to set the size of the arrays; don't use "magic
numbers."