LCA
Mannix_Y
这个作者很懒,什么都没留下…
展开
-
Nearest Common Ancestors(LCA)
A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the roo...原创 2019-02-23 22:25:44 · 296 阅读 · 0 评论 -
Query on a tree V (动态点分治预处理,LCA计算两点距离, 堆维护最短距离)
Query on a tree V You are given a tree (an acyclic undirected connected graph) with N nodes. The tree nodes are numbered from 1 to N. We define dist(a, b) as the number of edges on the path from nod...原创 2019-07-11 15:00:43 · 268 阅读 · 0 评论