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

Method clear

src/class184/Code02_Difficult1.java:97–107  ·  view source on GitHub ↗
(long[] tree, int l, int r, int i)

Source from the content-addressed store, hash-verified

95 }
96
97 public static void clear(long[] tree, int l, int r, int i) {
98 if (tree[i] == -INF) {
99 return;
100 }
101 tree[i] = -INF;
102 if (l < r) {
103 int mid = (l + r) >> 1;
104 clear(tree, l, mid, i << 1);
105 clear(tree, mid + 1, r, i << 1 | 1);
106 }
107 }
108
109 public static void update(long[] tree, int jobi, long jobv, int l, int r, int i) {
110 if (l == r) {

Callers 1

calcMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected