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

Method cut

src/class201/Code05_OTOCI1.java:154–160  ·  view source on GitHub ↗
(int x, int y)

Source from the content-addressed store, hash-verified

152 }
153
154 public static void cut(int x, int y) {
155 makeroot(x);
156 if (findroot(y) == x && fa[y] == x && ls[y] == 0 && rs[x] == y) {
157 fa[y] = rs[x] = 0;
158 up(x);
159 }
160 }
161
162 public static void main(String[] args) throws Exception {
163 FastReader in = new FastReader(System.in);

Callers

nothing calls this directly

Calls 3

makerootMethod · 0.95
findrootMethod · 0.95
upMethod · 0.95

Tested by

no test coverage detected