文件名称:tubianli
介绍说明--下载内容均来自于网络,请自行研究使用
图的遍历的演示(c 语言 数据结构课程设计题)
/*定义图*/
typedef struct{
int V[M]
int R[M][M]
int vexnum
}Graph
/*创建图*/
void creatgraph(Graph *g,int n)
{
int i,j,r1,r2
g->vexnum=n
/*顶点用i表示*/
for(i=1 i<=n i++)
{
g->V[i]=i
}
/*初始化R*/
for(i=1 i<=n i++)
for(j=1 j<=n j++)
{
g->R[i][j]=0
}
/*输入R*/
printf(\"Please input R(0,0 END):\\n\")
scanf(\"%d,%d\",&r1,&r2)
while(r1!=0&&r2!=0)
{
g->R[r1][r2]=1
g->R[r2][r1]=1
scanf(\"%d,%d\",&r1,&r2)
}
}
-graph traversal of the display (c language curriculum design data structures that) / * definition of the map * / typedef s truct V (int int [M] R [M] [M]) int vexnum Graph / * create map * / void creatgraph (Graph * g, int n) (int i, j, r1, r2 g -
/*定义图*/
typedef struct{
int V[M]
int R[M][M]
int vexnum
}Graph
/*创建图*/
void creatgraph(Graph *g,int n)
{
int i,j,r1,r2
g->vexnum=n
/*顶点用i表示*/
for(i=1 i<=n i++)
{
g->V[i]=i
}
/*初始化R*/
for(i=1 i<=n i++)
for(j=1 j<=n j++)
{
g->R[i][j]=0
}
/*输入R*/
printf(\"Please input R(0,0 END):\\n\")
scanf(\"%d,%d\",&r1,&r2)
while(r1!=0&&r2!=0)
{
g->R[r1][r2]=1
g->R[r2][r1]=1
scanf(\"%d,%d\",&r1,&r2)
}
}
-graph traversal of the display (c language curriculum design data structures that) / * definition of the map * / typedef s truct V (int int [M] R [M] [M]) int vexnum Graph / * create map * / void creatgraph (Graph * g, int n) (int i, j, r1, r2 g -
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 119128635tubianli.rar 列表 图的遍历.txt