No, that's not what my code does. It orders the row putting the greatest value (that is less than the previous diagonal value) into the diagonal. Look at my output again.
The two things you'll have to add for checks is: One, you have to make sure there isn't a higher value in the diagonal initally before the swap. Two, you have to make sure each column has at least one value lower than the preceding column.Code:8 6 6 1 5 4 3 6 5 1 2 3 4 2 4 1 8 4 6 1 5 6 2 6 5 1 4 1 4 2 3 3