CP Python LibraryGitHub

Lowest Common Ancestor

Data structure to find the lowest common ancestor of two nodes in a tree.

__init__

Arguments

Complexities

lca

Returns the lowest common ancestor of two nodes u and v.

Arguments

Returns

Complexities

Code Test