We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 944a0d8 commit cad7652Copy full SHA for cad7652
Maths/test/MatrixTransposition.test.js
@@ -0,0 +1,34 @@
1
+import { matrixTranspose } from '../MatrixTransposition'
2
+
3
+describe('Matrix Transpose', () => {
4
+ it('should transpose a 2x2 matrix', () => {
5
+ const matrix = [
6
+ [1, 2],
7
+ [3, 4]
8
+ ];
9
10
+ const transposedMatrix = matrixTranspose(matrix);
11
12
+ expect(transposedMatrix).toEqual([
13
+ [1, 3],
14
+ [2, 4]
15
+ ]);
16
+ });
17
18
+ it('should transpose a 3x3 matrix', () => {
19
20
+ [1, 2, 3],
21
+ [4, 5, 6],
22
+ [7, 8, 9]
23
24
25
26
27
28
+ [1, 4, 7],
29
+ [2, 5, 8],
30
+ [3, 6, 9]
31
32
33
34
+});
0 commit comments