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

Method update

src/class194/Code08_Tourists1.java:169–181  ·  view source on GitHub ↗
(int jobi, int jobv, int l, int r, int i)

Source from the content-addressed store, hash-verified

167 }
168
169 public static void update(int jobi, int jobv, int l, int r, int i) {
170 if (l == r) {
171 minv[i] = jobv;
172 } else {
173 int mid = (l + r) / 2;
174 if (jobi <= mid) {
175 update(jobi, jobv, l, mid, i << 1);
176 } else {
177 update(jobi, jobv, mid + 1, r, i << 1 | 1);
178 }
179 up(i);
180 }
181 }
182
183 public static int query(int jobl, int jobr, int l, int r, int i) {
184 if (jobl <= l && r <= jobr) {

Callers 1

mainMethod · 0.95

Calls 1

upMethod · 0.95

Tested by

no test coverage detected