下载此文档

最小生成树.docx


文档分类:IT计算机 | 页数:约8页 举报非法文档有奖
1/8
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/8 下载此文档
文档列表 文档介绍
// : 定义控制台应用程序的入口点。
//
#include ""
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#eight;
[vb][va]=weight;
}
}
int main()
{
int u;
MGraph G;
printf("\tWelcom to use this program!\n");
printf("Building Undugraph:\n");
CreatUDN(G);
printf("Please Input the Start Point:");
scanf("%d",&u);
PRIM(G,u);
return 0;
}
/*
# include <iostream>
# include <cmath>
# include <vector>
# define INFINITY 10000
# define MAX_VERTEX_NUM 20
using namespace std;
struct T{
int adjvex;
int lowcost;
} closedge[20];
typedef enum{ DG,DN,UDG,UDN} GraphKind;
typedef struct ArcCell
{
int adj;
char info;
}ArcCell,AdjMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct
{
int vexs[MAX_VERTEX_NUM];
AdjMatrix arcs;
int vexnum,arcnum;
GraphKind kind;
}MGraph;
int Location(MGraph G,int x)
{
for(int i=0;i<;i++)
if([i]==x)
{
return i;
break;
}
}
void CreateUDN(MGraph &G)
{
int IncInfo,v1,v2,w,i,j;
cout<<"input ,:"<<endl;
cin>>>>;
cout<<"\ninput []"<<endl;
for(i=0;i<;++i)
cin>>[i];
for(i=0;i<;++i)
for(j=0;j<;++j)
{
[i][j].adj=0;
[i][j].info=NULL;
}
cout<<"input 输入一条边依附的顶点:\n";
for(int

最小生成树 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数8
  • 收藏数0 收藏
  • 顶次数0
  • 上传人文库旗舰店
  • 文件大小13 KB
  • 时间2022-08-08
最近更新