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

Method off

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

Source from the content-addressed store, hash-verified

333 }
334
335 public static void off(int x) {
336 delAns(x);
337 sonMax[x].add(0);
338 addAns(x);
339 for (int u = x, fa = centfa[u]; fa > 0; u = fa, fa = centfa[u]) {
340 delAns(fa);
341 if (distFa[u].size() > 0) {
342 sonMax[fa].del(distFa[u].first());
343 }
344 distFa[u].add(getDist(x, fa));
345 sonMax[fa].add(distFa[u].first());
346 addAns(fa);
347 }
348 }
349
350 public static void prepare() {
351 for (int i = 1; i <= n; i++) {

Callers 1

mainMethod · 0.95

Calls 7

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

Tested by

no test coverage detected