MCPcopy 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
26bool is_ancestor(int u, int v)
27{
28 return tin[u] <= tin[v] and tout[u] >= tout[v];
29}
30
31int lca(int u, int v)
32{

Callers 1

lcaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected