資源簡介
該文件包括圖的頭文件,另外還實現了鄰接表的Dijkstra算法

代碼片段和文件信息
//AdjMGraph.c
#include?
typedef?char?DataType;
#define?MaxSize?10?//定義順序表數組的最大值
#define?MaxVertices?10?//定義頂點的最大值
#define?MaxWeight?10000?//定義無窮大的具體值
#include?“AdjMGraph.h“
#include?“AdjMGraphCreate.h“
void?main(void)
{
????AdjMGraph?g1;
????DataType?a[]?=?{‘A‘?‘B‘?‘C‘?‘D‘?‘E‘};
????RowColWeight?rcw[]?=?{{0110}?{0420}?{1330}?{2140}?{3250}};
????int?n?=?5?e?=?5;
????int?i?j;
????CreateGraph(&g1?a?n?rcw?e);?//創建圖
????DeleteEdge(&g1?0?4);?//刪除邊<04>
????printf(“頂點集合為:?“);
????for(i?=?0;?i?????????printf(“%c????“?g1.Vertices.list[i]);
????printf(“\n“);
????printf(“權值集合為:?\n“);
????for(i?=?0;?i?????{
????????for(j?=?0;?j?????????????printf(“%5d???“?g1.edge[i][j]);
????????printf(“\n“);
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????887??2018-04-27?19:52??圖論\AdjMGraph.c
?????文件???????3888??2018-05-02?23:00??圖論\AdjMGraph.h
?????文件????????493??2018-04-27?19:51??圖論\AdjMGraphCreate.h
?????文件???????2944??2018-05-03?16:17??圖論\Graph.h
?????文件???????2571??2018-05-03?16:21??圖論\GraphCreate.h
?????文件???????2784??2018-04-27?19:24??圖論\SeqList.h
?????文件???????1497??2019-02-06?22:57??圖論\鄰接表實現Dijkstra算法.c
?????目錄??????????0??2019-02-06?22:58??圖論
-----------?---------??----------?-----??----
????????????????15064????????????????????8
評論
共有 條評論