#include //蓝多多算法实验六
#include
using namespace std;
#define MAXVEX 100//最大顶点数
typedef char VertexType;//顶点类型
typedef int EdgeType;//边的权值
typedef struct
{
VertexType vexs[MAXVEX];//顶点表
EdgeType edges[MAXVEX][MAXVEX];//邻接矩阵
int n, e;//顶点数和边数
}MGraph;
MGraph CreateMGraph(int pd)//建立邻接矩阵
{
MGraph G;
int i, j, k, n;
cout G.n >> G.e;
cout k;//输入边的信息
G.edges[i][j] = k;
if (pd == 0)//无向图,边是双向的
G.edges[j][i] = k;
}
return G;
}
void DisplayMGraph(MGraph G, int pd)//分行输出
{
for (int i = 0; i
1665165634
查看更多评论