基于邻接矩阵表示法构建undirected network
发布时间
阅读量:
阅读量
//算法 采用邻接矩阵表示法创建无向网
#include <iostream>
using namespace std;
#define MaxInt 32767 //表示极大值,即∞
#define MVNum 100 //最大顶点数
#define OK 1
typedef char VerTexType; //假设顶点的数据类型为字符型
typedef int ArcType; //假设边的权值类型为整型
//- - - - -图的邻接矩阵存储表示- - - - -
typedef struct{
VerTexType vexs[MVNum]; //顶点表
ArcType arcs[MVNum][MVNum]; //邻接矩阵
int vexnum,arcnum; //图的当前点数和边数
}AMGraph;
int LocateVex(AMGra
全部评论 (0)
还没有任何评论哟~
