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

Method getDist

src/class185/Code04_Fantasy1.java:187–189  ·  view source on GitHub ↗
(int x, int y)

Source from the content-addressed store, hash-verified

185 }
186
187 public static int getDist(int x, int y) {
188 return dist[x] + dist[y] - (dist[getLca(x, y)] << 1);
189 }
190
191 public static void getSize1(int u, int fa) {
192 siz[u] = 1;

Callers 2

addMethod · 0.95
queryMethod · 0.95

Calls 1

getLcaMethod · 0.95

Tested by

no test coverage detected