#include<stdio.h>
#include<iostream>
using namespace std;
typedef int Status;
typedef char VerTexType;
typedef int ArcType;
#define MVNum 100
#define MaxInt 32767
#define OK 1
#define ERROR 0
#define ture 1
#define flase 0
typedef struct //图的邻接矩阵法存储表示
{
VerTexType vexs[10][MVNum];
ArcType arcs[MVNum][MVNum];
int vexnum,arcnum;
}AMGraph;
Status LocateVex(AMGraph G,char v[10]) //寻找v所在位置
{
int i;
char *q=v;
for(i=0;i<G.vexnum;i++)
while(strcmp(G.vexs[i],q)==0)
return i;
return OK;
}
Status CreateUDN(AMGraph &G) //采用邻接矩阵法创捷有向网
{
printf("请依次输入图的点数和边数:");
cin>>G.vexnum>>G.arcnum;
int i,j,k,w
数据结构之最短路径
最新推荐文章于 2023-02-10 20:25:21 发布