#include<iostream>
#include<stdio.h>
#include <stdlib.h>
using namespace std;
#define MAXVEX 100
#define INF 100000000
#define MAXE 100
typedef char VertexType[10];
typedef struct vertex
{
int adjvex;
VertexType data;
} VType;
typedef struct graph
{
int n, e;
VType vexs[MAXVEX];
int edges[MAXVEX][MAXVEX];
}MatGraph;
typedef struct
{
int u;
int v;
int w;
}Edge;
void CreateGraph(MatGraph& g, int A[][MAXVEX], int n, int e)
{
int i, j;
g.n = n;
g.e = e;
for (i = 0; i < n; i++)
{
for (j = 0; j < n; j++)
{
g.edges[i][j] = A[i][j];
}
}
}
void DestroyGraph(MatGraph g)
{
}
void DispGraph(MatGraph g)
{
int i, j;
for (i = 0; i < g.n; i++)
{
for (j = 0; j < g.n; j++)
{
if (g.edges[i][j] < INF)
{
pr
c语言的普利姆算法实现代码
最新推荐文章于 2024-05-20 21:10:36 发布