Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
}
32
int dist(int u, int v) {
33
int lc = lca(u, v);
34
return dep[u] + dep[v] - 2 * dep[lc];
35
}
36
int isanc(int u, int v) {
37
return (st[u] <= st[v]) && (en[v] <= en[u]);
38
}
Callers
nothing calls this directly
Calls
1
lca
Function · 0.70
Tested by
no test coverage detected