正在加载图片...
2、图的物理存储(续) 2.2邻接表表示法 。 邻接表的C语言描述 define MAXNODE typedef struct st arc fint adivex; adjvex data nextarc weighttype date; /孤的权值类型 struct st arc *nextarc; typedef struct nodetype vexdata; 顶点的数据类型 Vexdata firstarc struct st arc *firstarc; Headnode; Headnodes结构类型定义 Headnode adjlist[MAXNODE]; 电子科技大学刘民岷 图 8电子科技大学 刘民岷 图 8 2.2 邻接表表示法 • 邻接表的C语言描述 adjvex data nextarc Vexdata firstarc # define MAXNODE typedef struct st_arc {int adivex; weighttype date; //弧的权值类型 struct st_arc *nextarc; } typedef struct {nodetype vexdata; //顶点的数据类型 struct st_arc *firstarc; }Headnode; //Headnode结构类型定义 Headnode adjlist[MAXNODE];
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有