随笔分类 -  数据结构 - LCA

摘要:A . After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the sh 阅读全文
posted @ 2018-09-10 20:05 楼主好菜啊 阅读(346) 评论(0) 推荐(0) 编辑
摘要: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 t 阅读全文
posted @ 2018-02-07 15:10 楼主好菜啊 阅读(162) 评论(0) 推荐(0) 编辑
摘要:There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want 阅读全文
posted @ 2018-02-06 23:29 楼主好菜啊 阅读(239) 评论(0) 推荐(0) 编辑
摘要:推荐博客 : http://blog.csdn.net/lw277232240/article/details/72870644 LCA 就是去寻找最近公共祖先 ,如上图中 10 与 11 的LCA是 6 ,7 和 12 的LCA 是 4 。 通过这个我们可以解决的一类问题就是 求任意两点之间的距离 阅读全文
posted @ 2018-02-06 23:24 楼主好菜啊 阅读(175) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示