随笔分类 - 数据结构 - 树的重心
摘要:Now Fox Ciel becomes a commander of Tree Land. Tree Land, like its name said, has n cities connected by n - 1 undirected roads, and for any two cities
阅读全文
摘要:Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Give an i
阅读全文
摘要:推荐博客:https://www.cnblogs.com/patrickzhou/p/5867208.html Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the t
阅读全文
摘要:推荐博客 : http://blog.csdn.net/ZHangFFYY/article/details/77871897 我们对一个图的存储基本有两种,邻近矩阵和邻接表 ,在补充一个链式前向星 用此方法存图 , 首先先定义一个结构体数组 struct node { int to, w; // t
阅读全文