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

Method link

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

Source from the content-addressed store, hash-verified

145 }
146
147 public static void link(int x, int y) {
148 makeroot(x);
149 if (findroot(y) != x) {
150 fa[x] = y;
151 }
152 }
153
154 public static void cut(int x, int y) {
155 makeroot(x);

Callers 1

mainMethod · 0.95

Calls 2

makerootMethod · 0.95
findrootMethod · 0.95

Tested by

no test coverage detected