MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / buildOut

Method buildOut

src/class195/Code03_Road1.java:54–67  ·  view source on GitHub ↗
(int l, int r)

Source from the content-addressed store, hash-verified

52 }
53
54 public static int buildOut(int l, int r) {
55 int rt;
56 if (l == r) {
57 rt = l;
58 } else {
59 rt = ++cntt;
60 int mid = (l + r) >> 1;
61 ls[rt] = buildOut(l, mid);
62 rs[rt] = buildOut(mid + 1, r);
63 addEdge(ls[rt], rt, 0);
64 addEdge(rs[rt], rt, 0);
65 }
66 return rt;
67 }
68
69 public static int buildIn(int l, int r) {
70 int rt;

Callers 1

mainMethod · 0.95

Calls 1

addEdgeMethod · 0.95

Tested by

no test coverage detected