Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ is_ancestor
Function
is_ancestor
Trees/LCA.cpp:26–29 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
24
}
25
26
bool is_ancestor(int u, int v)
27
{
28
return tin[u] <= tin[v] and tout[u] >= tout[v];
29
}
30
31
int lca(int u, int v)
32
{
Callers
1
lca
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected