Back to snippets
AlgorithmMotionTypeScript

Matrix Transpose

Watch the algorithm fill result[j][i] = matrix[i][j] — one assignment at a time.

Preview

idle

matrix

3×5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
i=–, j=–

result

5×3

·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
j=–, i=–