写出向存储结构为邻接矩阵的无向图G中插入一条边(x,y)的算法。算法的头函数为:
void AddEdgetoGraph(Graph*G,VertexType X,VertexType y>,无向图G的存储结构
为:
#define MaxVertex num
typedef char VertexType;
typedef int EdgeType;
typedef struct graph {
int n,e;//图的实际顶点数和边数
EdgeType edge [MaxVertex][MaxVertex];//邻接矩阵
VertexType vertex[MaxVertex];//顶点表
}Graph;