边集数组类型定义
typedef struct {
int fromvex;
int endvex;
int weight;
}edge;
typedef struct {
edge *set;
int arc_num;
int vex_num;
}edgeset;
typedef struct listnode{
int adjvex;
int weight;
struct listnode *next;
}listnode;
typedef listnode* adjlist[MAX_VERTEX_NUM];
//该算法中的图用邻接矩阵存储,CT为存储着最小生成树的边集数组
void Prim(MGraph g,edgeset *CT,int sta_vex) //sta_vex是初始点
{
int i,j,k,min,m,p,w;
int tm_frvex,tm_envex,tm_weight;
int t = 0;