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

Method main

java/Chapter 11/Question11_6/QuestionA.java:21–40  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

19 }
20
21 public static void main(String[] args) {
22 int M = 10;
23 int N = 5;
24 int[][] matrix = new int[M][N];
25 for (int i = 0; i < M; i++) {
26 for (int j = 0; j < N; j++) {
27 matrix[i][j] = 10 * i + j;
28 }
29 }
30
31 AssortedMethods.printMatrix(matrix);
32
33 for (int i = 0; i < M; i++) {
34 for (int j = 0; j < M; j++) {
35 int v = 10 * i + j;
36 System.out.println(v + ": " + findElement(matrix, v));
37 }
38 }
39
40 }
41
42}

Callers

nothing calls this directly

Calls 2

printMatrixMethod · 0.95
findElementMethod · 0.95

Tested by

no test coverage detected