Question 1 of 5
A camp lantern grid is walked in row-major order.
int[][] lamps = { {9, 2, 4}, {1, 8, 6} };
for (int r = 0; r < lamps.length; r++) {
for (int c = 0; c < lamps[0].length; c++) {
System.out.print(lamps[r][c]);
System.out.print(" ");
}
}
| Visit number | row r | col c | Value printed |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 |
(a) Complete the visit table. (b) Write the exact text printed, including spaces. (c) Explain why (1, 1) cannot print before (0, 2).