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

Method main

java/Chapter 9/Question9_1/Question.java:30–47  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

28 }
29
30 public static void main(String[] args) {
31 for (int i = 0; i < 30; i++) {
32 long t1 = System.currentTimeMillis();
33 int[] map = new int[30 + 1];
34 for (int j = 0; j < map.length; j++) {
35 map[j] = -1;
36 }
37 int c1 = countWaysDP(i, map);
38 long t2 = System.currentTimeMillis();
39 long d1 = t2 - t1;
40
41 long t3 = System.currentTimeMillis();
42 int c2 = countWaysRecursive(i);
43 long t4 = System.currentTimeMillis();
44 long d2 = t4 - t3;
45 System.out.println(i + " " + c1 + " " + c2 + " " + d1 + " " + d2);
46 }
47 }
48
49}

Callers

nothing calls this directly

Calls 2

countWaysDPMethod · 0.95
countWaysRecursiveMethod · 0.95

Tested by

no test coverage detected