 |
|

Which if statement should be inserted into the code below to make the fragment create the transpose of the 2-D array? A transpose has the property that
Transpose[j][k] = Original[k][j].
int[][] twod = { { 1, 2, 3 },
{ 4, 5, 6 },
{ 7, 8, 9 }
};
final int LIM = twod.length;
for (int j = 0; j < LIM; j++)
for (int k = 0; k < LIM; k++)
if ( ???? ) {
int x = twod[j][k];
twod[j][k] = twod[k][j];
twod[k][j] = x;
}
|

 |
| |
|
|
 |