struct based lca, includes dist function since it is commonly used. particularly long (62 character) initialization line might need to be refined later.
Summary
Includes lca and dist function. Initializes LCA structure allowing for lowest common ancestor queries given a (undirected) zero based adjacency list representing a tree. Tree is rooted at 0 by default (perhaps a parameter may be desirable?)
struct based lca, includes dist function since it is commonly used. particularly long (62 character) initialization line might need to be refined later.
Summary
Includes lca and dist function. Initializes LCA structure allowing for lowest common ancestor queries given a (undirected) zero based adjacency list representing a tree. Tree is rooted at 0 by default (perhaps a parameter may be desirable?)
Submission Link/Screenshots
https://cses.fi/problemset/result/10795064/
Checklist