I\'m self teaching myself some java and I\'m stuck on creating a 2D array that initializes it with random values and then creates the transpose of the array.
For a square matrix, instead of iterating through the entire array, you just iterate through the diagonally half of the 2D array and swap the values with the corresponding indices.
public void transposeMatrix(int[][] a) {
for(int i=0 ; i