資源簡介
有圖的遍歷,排序,最短路徑的代碼,創建圖的鄰接矩陣,圖的鄰接矩陣轉換為鄰接表
代碼片段和文件信息
#include?
#include?
#include?
#define?MaxStr?20
typedef?int?Status;
typedef?int?ElemType;
typedef?struct{????
????ElemType?VNode;
????int?indgree;
????}VexType;
typedef?struct?Arc{
????VexType?Adj;
????unsigned?int?Weight;
????struct?Arc?*NextArc;
????}ArcType;
typedef?struct{????????????????????????????????????
????VexType?*Vex;
????ArcType?**FirstArc;??????????????????//鄰接表;
//????ArcType?**InvertArc;???????????????//逆鄰接表;
????int?VexNums;?????????????????????????//頂點總數;
????}DLGraph;????????????????????????????//圖的鄰接表結構定義;
typedef?struct{
????ElemType?*Vex;
????unsigned?int?**Arc;????????????????????????????????
????int?VexNums;
????}DMGraph;????????????????????????????//圖的鄰接矩陣結構定義;
//================================================
- 上一篇:labview cpu監測
- 下一篇:雙樹復數小波變換紋理特征提取算法
評論
共有 條評論