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

Method getDist

src/class185/Code07_HideSeek1.java:273–275  ·  view source on GitHub ↗
(int x, int y)

Source from the content-addressed store, hash-verified

271 }
272
273 public static int getDist(int x, int y) {
274 return dep[x] + dep[y] - (dep[getLca(x, y)] << 1);
275 }
276
277 public static int getCentroid(int u, int fa) {
278 // getSize1(u, fa);

Callers 3

onMethod · 0.95
offMethod · 0.95
prepareMethod · 0.95

Calls 1

getLcaMethod · 0.95

Tested by

no test coverage detected