MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / dist

Function dist

Graph Theory/Virtual Tree.cpp:32–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 return u;
31}
32int dist(int u, int v) {
33 int lc = lca(u, v);
34 return dep[u] + dep[v] - 2 * dep[lc];
35}
36int isanc(int u, int v) {
37 return (st[u] <= st[v]) && (en[v] <= en[u]);
38}

Callers

nothing calls this directly

Calls 1

lcaFunction · 0.70

Tested by

no test coverage detected