MCPcopy Create free account
hub / github.com/careercup/ctci / main

Method main

java/Chapter 1/Question1_7/Question.java:127–149  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

125 }
126
127 public static void main(String[] args) {
128 int nrows = 10;
129 int ncols = 15;
130 int[][] matrix1 = AssortedMethods.randomMatrix(nrows, ncols, 0, 100);
131 int[][] matrix2 = cloneMatrix(matrix1);
132
133 AssortedMethods.printMatrix(matrix1);
134
135 setZeros(matrix1);
136 setZeros2(matrix2);
137
138 System.out.println();
139
140 AssortedMethods.printMatrix(matrix1);
141 System.out.println();
142 AssortedMethods.printMatrix(matrix2);
143
144 if (matricesAreEqual(matrix1, matrix2)) {
145 System.out.println("Equal");
146 } else {
147 System.out.println("Not Equal");
148 }
149 }
150}

Callers

nothing calls this directly

Calls 6

randomMatrixMethod · 0.95
cloneMatrixMethod · 0.95
printMatrixMethod · 0.95
setZerosMethod · 0.95
setZeros2Method · 0.95
matricesAreEqualMethod · 0.95

Tested by

no test coverage detected