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

Method findroot

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

Source from the content-addressed store, hash-verified

127 }
128
129 public static int findroot(int x) {
130 access(x);
131 splay(x);
132 down(x);
133 while (ls[x] != 0) {
134 x = ls[x];
135 down(x);
136 }
137 splay(x);
138 return x;
139 }
140
141 public static void split(int x, int y) {
142 makeroot(x);

Callers 3

linkMethod · 0.95
cutMethod · 0.95
mainMethod · 0.95

Calls 3

accessMethod · 0.95
splayMethod · 0.95
downMethod · 0.95

Tested by

no test coverage detected