I have a two-dimensional array:
function getMatrix(size) {
var matrix = [];
for (var i = 0; i < size; i++) {
matrix[i] = new Array(size);
}
return matrix;
};
It is filled with numeric values, so every existing matrix[i][j]
is a Number
. What is the best way to get a sequence of i
and j
pairs that will correspond to a seqence of highest to lowest values in the matrix?