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

Method getAns2

src/class187/Code02_Cobweb1.java:230–238  ·  view source on GitHub ↗
(int u)

Source from the content-addressed store, hash-verified

228 }
229
230 public static void getAns2(int u) {
231 int edge = getCentroidEdge(u, 0);
232 if (edge > 0) {
233 vis[edge >> 1] = true;
234 calc(edge);
235 getAns2(to2[edge]);
236 getAns2(to2[edge ^ 1]);
237 }
238 }
239
240 public static void getAns1(int u, int fa) {
241 siz[u] = 1;

Callers 1

mainMethod · 0.95

Calls 2

getCentroidEdgeMethod · 0.95
calcMethod · 0.95

Tested by

no test coverage detected