设图为:
则图的邻接表为:
下面,我们看看程序:
#include <iostream>#define VERTEX 4using namespace std;// 边表结点typedef struct node{
int index; struct node *next;}Node;// 顶点表结点typedef struct
设图为:
则图的邻接表为:
下面,我们看看程序:
#include <iostream>#define VERTEX 4using namespace std;// 边表结点typedef struct node{
int index; struct node *next;}Node;// 顶点表结点typedef struct