LCA
lzr010506
OI党
展开
-
倍增LCA poj1330 Nearest Common Ancestors
DescriptionA 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原创 2016-05-17 09:39:15 · 948 阅读 · 0 评论 -
SPOJ PT07J Query on a tree II
You are given a tree (an undirected acyclic connected graph) with N nodes, and edges numbered 1, 2, 3…N-1. Each edge has an integer value assigned to it, representing its length.We will ask you to perf原创 2016-05-17 18:01:50 · 587 阅读 · 0 评论