test
#include
#include "graph.h"
#include "err.h"
int main()
{
int n;
Graph G;
printf("enter the number of nodes in graph maximum = %d\n",max);
scanf("%d",&n);
G = CreateGraph(n);
buildadjm(G);
printf("\nAdjacency matrix:\n");
printadjm(G);
printf("\nDepth first search:\n");
ClearVisited(G);
dfs(G);
DisposeGraph(G);
putchar('\n');
system("pause");
return 0;
}
#include <stdio.h> #include "graph.h" #include "fatal.h" main() { int n; Graph G; printf("enter the number of nodes in graph maximum = %d\n",max); scanf("%d",&n); G = CreateGraph(n); //buildadjm(G); FillGraph( G ); printf("\nAdjacency matrix:\n"); printadjm(G); printf("\nDepth first search:\n"); ClearVisited(G); dfs(G); printf("\nSpanning tree:\n"); dfsst(G); DisposeGraph(G); putchar('\n'); return 0; }