Multidimensional Arrays
Transpose of Matrix
Transpose of square matrix of size N*N. int x [ 3 ] [ 3 ]
N —> Number of Row and column
1 1 1
changing rows to columns and
columns to rows. 2 2 2
3 3 3
Multidimensional Arrays
int x [ 3 ] [ 3 ] int x [ 3 ] [ 3 ]
1 1 1 1 2 3
R -> C
2 2 2 C -> R 1 2 3
3 3 3 1 2 3
1 1 1
2 2 2
3 3 3
Multidimensional Arrays
int x [ 3 ] [ 3 ] int x [ 3 ] [ 3 ]
1 1 1 1 2 3
R -> C
2 2 2 C -> R 1 2 3
3 3 3 1 2 3
Row 0 1 1 1
J=0
2 2 2
3 3 3
Multidimensional Arrays
int x [ 3 ] [ 3 ] int x [ 3 ] [ 3 ]
1 1 1 1 2 3
R -> C
2 2 2 C -> R 1 2 3
3 3 3 1 2 3
1 1 1
J=0
Row 1 2 2 2 J=0 J=1
3 3 3
Multidimensional Arrays
int x [ 3 ] [ 3 ] int x [ 3 ] [ 3 ]
1 1 1 1 2 3
R -> C
2 2 2 C -> R 1 2 3
3 3 3 1 2 3
1 1 1
J=0
2 2 2 J=0 J=1
Row 2 3 3 3 J=0 J=1 J=2