Lowest Common Ancestor(CodeChef TALCA)
In a rooted tree, the
lowest common ancestor (or LCA for short) of two vertices u and
v is defined as the lowest vertex that is ancestor of both that two vertices.
Given a tree of N vertices, yo
原创
2017-04-28 00:34:51 ·
458 阅读 ·
0 评论