I am looking for a way to traverse a 2d n by m int array (int[col][row]) first row by row (simple part) and then column by column, in Java. Here is the code for doing row by row, is there a way to do col by col?
for(int i = 0; i < display.length; i++){
for (int j = 0; j < display[i].length; j++){
if (display[i][j] == 1)
display[i][j] = w++;
else w = 0;
}
}