
并查集
文章平均质量分 89
qq_30339595
人类,诗意地栖息在大地上。
展开
-
Is It A Tree?
题目描述A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties. The...原创 2018-02-22 13:48:55 · 948 阅读 · 0 评论 -
最短路径(并查集+kruskal最小生成树)
时间限制:1秒 空间限制:65536K 热度指数:1293 算法知识视频讲解题目描述N个城市,标号从0到N-1,M条道路,第K条道路(K从0开始)的长度为2^K,求编号为0的城市到其他城市的最短距离输入描述:第一行两个正整数N(2<=N<=100)M(M<=500),表示有N个城市,M条道路 接下来M行两个整数,表示相连的两个城市的编号输出描述:N-1行,表示0号城市到其他城市的...原创 2018-03-03 22:23:51 · 856 阅读 · 0 评论