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 067e39d commit 10932ccCopy full SHA for 10932cc
DataStructures/Matrix/Matrix.java
@@ -211,11 +211,14 @@ public Matrix multiply(Matrix other) throws RuntimeException {
211
* @return boolean
212
*/
213
public boolean equals(Matrix other) {
214
+ if (this.getRows() != other.getRows() || this.getColumns() != other.getColumns())
215
+ return false;
216
+
217
for (int i = 0; i < this.data.length; i++)
218
for (int j = 0; j < this.data[0].length; j++)
219
if (this.data[i][j] != other.data[i][j])
220
return false;
-
221
222
return true;
223
}
224
0 commit comments