最小生成树
tanhaiyuan
这个作者很懒,什么都没留下…
展开
-
poj 2485Highways(最小生成树 Kruskal)
很明显的一道最小生成树的题…… #include#include#includeusing namespace std;struct Edge{ int start;//边的起点 int end;//边的中点 int weight;//边的权值}edges[15原创 2011-08-25 11:40:50 · 524 阅读 · 0 评论 -
poj 1258Agri-Net(prime,Kruskal )
prime#include#includeusing namespace std;int a[101][101];//矩阵表示图int lowcost[101], closest[101];//初始都为0int Prim(int n){ int i, j, k,原创 2011-08-25 11:49:42 · 694 阅读 · 0 评论 -
poj 1861Network(最小生成树)
原来样例是错……#include#includeusing namespace std;struct edges{ int s, e; int len;}edge[15001], record[1001];int parent[1001];in原创 2011-09-24 14:02:47 · 564 阅读 · 1 评论 -
poj 2485Highways(小生成树)
注意可能出现重边……#include#include#includeusing namespace std;struct Edge{ int start;//边的起点 int end;//边的中点 int weight;//边的权值}edges[150001];int parent[501];//存储每个点的父节点void MakeSet( int n)//初始化并查集原创 2011-08-27 23:48:31 · 411 阅读 · 0 评论