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

Method cut

src/class201/Code07_Network1.java:164–170  ·  view source on GitHub ↗
(int x, int y)

Source from the content-addressed store, hash-verified

162 }
163
164 public static void cut(int x, int y) {
165 makeroot(x);
166 if (findroot(y) == x && fa[y] == x && ls[y] == 0 && rs[x] == y) {
167 fa[y] = rs[x] = 0;
168 up(x);
169 }
170 }
171
172 public static int node(int c, int x) {
173 return c * n + x;

Callers 1

disconnectMethod · 0.95

Calls 3

makerootMethod · 0.95
findrootMethod · 0.95
upMethod · 0.95

Tested by

no test coverage detected