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

Method rangeToX

src/class195/Code03_Road1.java:98–110  ·  view source on GitHub ↗
(int jobl, int jobr, int jobx, int l, int r, int i)

Source from the content-addressed store, hash-verified

96 }
97
98 public static void rangeToX(int jobl, int jobr, int jobx, int l, int r, int i) {
99 if (jobl <= l && r <= jobr) {
100 addEdge(i, jobx, 0);
101 } else {
102 int mid = (l + r) >> 1;
103 if (jobl <= mid) {
104 rangeToX(jobl, jobr, jobx, l, mid, ls[i]);
105 }
106 if (jobr > mid) {
107 rangeToX(jobl, jobr, jobx, mid + 1, r, rs[i]);
108 }
109 }
110 }
111
112 public static void rangeToRange(int a, int b, int c, int d, int w) {
113 int x = ++cntt;

Callers 1

rangeToRangeMethod · 0.95

Calls 1

addEdgeMethod · 0.95

Tested by

no test coverage detected