(int[][] m1, int[][] m2)
| 100 | } |
| 101 | |
| 102 | public static boolean matricesAreEqual(int[][] m1, int[][] m2) { |
| 103 | if (m1.length != m2.length || m1[0].length != m2[0].length) { |
| 104 | return false; |
| 105 | } |
| 106 | |
| 107 | for (int k = 0; k < m1.length; k++) { |
| 108 | for (int j = 0; j < m1[0].length; j++) { |
| 109 | if (m1[k][j] != m2[k][j]) { |
| 110 | return false; |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | return true; |
| 115 | } |
| 116 | |
| 117 | public static int[][] cloneMatrix(int[][] matrix) { |
| 118 | int[][] c = new int[matrix.length][matrix[0].length]; |