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

Method buildIn

src/class195/Code02_Journeys1.java:62–75  ·  view source on GitHub ↗
(int l, int r)

Source from the content-addressed store, hash-verified

60 }
61
62 public static int buildIn(int l, int r) {
63 int rt;
64 if (l == r) {
65 rt = l;
66 } else {
67 rt = ++cntt;
68 int mid = (l + r) >> 1;
69 ls[rt] = buildIn(l, mid);
70 rs[rt] = buildIn(mid + 1, r);
71 addEdge(rt, ls[rt], 0);
72 addEdge(rt, rs[rt], 0);
73 }
74 return rt;
75 }
76
77 public static void xToRange(int jobx, int jobl, int jobr, int l, int r, int i) {
78 if (jobl <= l && r <= jobr) {

Callers 1

mainMethod · 0.95

Calls 1

addEdgeMethod · 0.95

Tested by

no test coverage detected