随笔分类 -  数据结构

最小生成树模板&&总结--Prim&&Kruskal
摘要:一.最小生成树:连通N个点的边权值总和最小的树。 二.时间复杂度 Prim算法:时间复杂度O(|V|2+|E|),O(|E|log|V|) Kruskal算法:时间复杂度O(|E|log|E|) 算法的选择: 从图的稀疏程度考虑(稠密图Prim,稀疏图Kruskal或Prim + Heap) 三.具 阅读全文

posted @ 2018-08-07 17:27 一零七 阅读(189) 评论(0) 推荐(0)

H - 最小生成树模板+1(适合Prim) UVA - 10369
摘要:H - 最小生成树模板+1(适合Prim) UVA - 10369 The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two diff 阅读全文

posted @ 2018-08-07 17:18 一零七 阅读(158) 评论(0) 推荐(0)

G - 最小生成树模板(适合Kruskal) UVALive - 2515 Networking
摘要:G - 最小生成树模板(适合Kruskal) UVALive - 2515 You are assigned to design network connections between certain points in a wide area. You are given a set of poi 阅读全文

posted @ 2018-08-07 17:17 一零七 阅读(136) 评论(0) 推荐(0)

E - 带删除并查集 UVA - 11987 Almost Union-Find
摘要:UVA - 11987 Almost Union-Find I hope you know the beautiful Union-Find structure. In this problem, you’re to implement something similar, but not iden 阅读全文

posted @ 2018-08-06 16:23 一零七 阅读(195) 评论(0) 推荐(1)

B - 简单带权并查集 POJ - 2492 A Bug's Life
摘要:POJ - 2492 http://poj.org/problem?id=2492 Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that th 阅读全文

posted @ 2018-08-06 11:25 一零七 阅读(145) 评论(0) 推荐(0)

J - Chores POJ - 1949 Chores 树形DP
摘要:J - Chores POJ - 1949 Farmer John's family pitches in with the chores during milking, doing all the chores as quickly as possible. At ... 阅读全文

posted @ 2018-08-03 15:25 一零七 阅读(181) 评论(0) 推荐(0)

E - Longest Regular Bracket Sequence CodeForces - 5C DP+栈
摘要:E - Longest Regular Bracket Sequence CodeForces - 5C This is yet another problem dealing with regular bracket sequences.We should remi... 阅读全文

posted @ 2018-08-03 09:42 一零七 阅读(171) 评论(0) 推荐(0)

导航