?? graph.h
字號:
#ifndef GRAPH_H_H
#define GRAPH_H_H
#include"Queue.h"
#define UDG 1 //無向圖
#define DG 2 //有向圖
#define UDN 3 //無向網
#define DN 4 //有向網
typedef int InfoType;
typedef char VertexType[50];
typedef struct ArcNode
{
int adjvex;
struct ArcNode *next;
InfoType *info;
}ArcNode;
typedef struct VNode
{
VertexType data;
ArcNode *firstarc;
}VNode;
typedef struct
{
int vexnum,arcnum;
int kind;
VNode *pVNode;
}ALGraph;
typedef struct PathNode
{
int index;//路經中頂點在鄰接表里的下標
struct PathNode *next;//路經中的下一頂點
}PathNode,*Path;
typedef struct PPath
{
Path head;//路經投指針
struct PPath * next;//下一條路經
}PPath;
typedef struct DestNode
{
int index;
int MinPath;
bool forever;
PPath *pallpath;
struct DestNode *next;
}DestNode;
void MinPath(ALGraph &G,VertexType source);
void CreateG(ALGraph &G,int kind);//kind為圖類型
bool CreateGraph(ALGraph &G);
void DFSTraverse(ALGraph &G,void (*visit)(VNode &vnode));
void BFSTraverse(ALGraph &G,void (*visit)(VNode &vnode));
void SaveToFile(ALGraph &G,char filename[50]);
void ReadFromFile(ALGraph &G,char filename[50]);
void ToAdjMatrix(ALGraph &G,VertexType *&a,int **&pmatrix);
void MinPath(ALGraph &G,VertexType v0);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -