顺序查找的编程出现找不到头文件
#include <stdio.h>#include "grath.h"
#define MAXE 100
typedef int InfoType;
#define MAXV 100
typedef int InfoType;
#define MAXV 100
#define INF32767
typedef struct
{ int no;
InforType info;
}VertexType;
typedef struct
{ int edges [MAXV][MAXV];
int n,e;
VertexType vexs[MAXV];
}MGraph;
typedef struct ANode
{ int adjvex;
struct ANode * nextarc;
InfoType info;
}ArcNode;
typedef int Vertex;
typedef struct Vnode
{ Vertex data;
ArcNode * firstarc;
}VNode;
typedef VNode AdjList[MAXV];
typedef struct
{ AdjList adjlist;
int n, e;
}ALGraph;
#define INF32767
typedef struct
{ int no;
InforType info;
}VertexType;
typedef struct
{ int edges [MAXV][MAXV];
int n,e;
VertexType vexs[MAXV];
}MGraph;
//
rypedef struct ANode
{ int adjvex;
struct ANode * nextarc;
InfoType info;
}ArcNode;
typedef int Vertex;
typedef struct Vnode
{ Vertex data;
ArcNode * firstarc;
}VNode;
typedef VNode AdjList[MAXV];
typedef struct
{ AdjList adjlist;
int n, e;
}ALGraph;*/
typedef struct
{
int u;
int v;
int w;
}Edge;
extern void DispMatl (MGraph)
void SortEdge( MGraph g, Edge E[])
{ int i,j,k=0;
Edge temp;
for (i=0; i<g.n; i++)
for(j=0;j<g.n; j++)
if(g.edges[i][j]<INF)
{ E[k].u=i;
E[k].v=j;
E[k].w=g.edges[i][j];
k++;
}
for(i=1; i<k; i++)
{ temp=E[i];
j=i-1;
while (j>=0 && temp.w<E[j].w)
{ E[j+1]=E[j];
j--;
}
E[j+1]=temp;
}
}
void kruskal(Edge E[],int n, int e)
{ int i, j, m1, m2, sn1, sn2,k;
int vset [MAXE];
for (i=0; i<n; i++) vset[i]=i;
k=1;
j=0;
while(k<n)
{ m1=E[j],u; m2=E[i]=i;
sn1 =vset[m1]; sn2 = vset[m2];
if(sn1!=sn2)
{ printf (" (%d,%d):%d\n",m1,m2,E[j].w);
k++;
for (i=0;i<n;i++)
if(vset[i]==sn2)
vset[i]=sn1;
}
j++;
}
}
void main()
{ int i,j,u=3;
MGraph g;
Edge E[MAXE];
int A[MAXV] [NAXV] ={{0,5,8,7,INF,3}, {5,0,4,INF,INF},
{8,4,0,5,INF,9}, {7,INF,5,0,5,INF},
{INF,INF,INF,5,0,1},{3,INF,9,INF,1,0}};
g.n=6;g.e=10;
for (i=0;i<g.n;i++)
for(j=0;j<g.n'j++)
g.edges[i][j]=A[i][j];
SortEdges(g,E);
printf(" 图G的临界矩阵:\n");
DispMatl(g);
printf("普利姆算法求解结果: \n");
prim(g, 0);
printf(" \n ");
}