Assume that a square matrix mat is defined by
int[][] mat = new int[SIZE][SIZE];
//SIZE is an integer constant >= 2
What does the following code segment do?
for (int i = 0; i < SIZE - 1; i++)
for (int j = 0; j < SIZE - i - 1; j++)
swap(mat, i, j, SIZE - j - 1, SIZE - i - 1);
You may assume the existence of this swap method:
/** Interchange mat[a][b] and mat[c][d]. */
public void swap(int[][] mat, int a, int b, int c, int d)
(A) Reflects mat through its major diagonal. For example,
2 6 → 2 4
4 3 6 3
(B) Reflects mat through its minor diagonal. For example,
2 6 → 3 6
4 3 4 2
(C) Reflects mat through a horizontal line of symmetry. For example,
2 6 → 4 3
4 3 2 6
(D) Reflects mat through a vertical line of symmetry. For example,
2 6 → 6 2
4 3 3 4
(E) Leaves mat unchanged