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

Method findroot

src/class201/Code07_Network1.java:139–149  ·  view source on GitHub ↗
(int x)

Source from the content-addressed store, hash-verified

137 }
138
139 public static int findroot(int x) {
140 access(x);
141 splay(x);
142 down(x);
143 while (ls[x] != 0) {
144 x = ls[x];
145 down(x);
146 }
147 splay(x);
148 return x;
149 }
150
151 public static void split(int x, int y) {
152 makeroot(x);

Callers 4

linkMethod · 0.95
cutMethod · 0.95
updateEdgeMethod · 0.95
queryMethod · 0.95

Calls 3

accessMethod · 0.95
splayMethod · 0.95
downMethod · 0.95

Tested by

no test coverage detected