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

Method on

src/class185/Code07_HideSeek1.java:320–333  ·  view source on GitHub ↗
(int x)

Source from the content-addressed store, hash-verified

318 }
319
320 public static void on(int x) {
321 delAns(x);
322 sonMax[x].del(0);
323 addAns(x);
324 for (int u = x, fa = centfa[u]; fa > 0; u = fa, fa = centfa[u]) {
325 delAns(fa);
326 sonMax[fa].del(distFa[u].first());
327 distFa[u].del(getDist(x, fa));
328 if (distFa[u].size() > 0) {
329 sonMax[fa].add(distFa[u].first());
330 }
331 addAns(fa);
332 }
333 }
334
335 public static void off(int x) {
336 delAns(x);

Callers 1

mainMethod · 0.95

Calls 7

delAnsMethod · 0.95
addAnsMethod · 0.95
getDistMethod · 0.95
firstMethod · 0.80
delMethod · 0.45
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected