⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graph.h

📁 图的最短路径查询
💻 H
字号:
#include <iostream>
#include <fstream>
#include <string>
#include <conio.h>
#include <dos.h>

using namespace std;

//地名节点
typedef struct
{
	string name;
} vexnode;

//边节点
typedef struct
{
	int weight;
	int price;
	int win;
	int pin;
} edgenode;

//输出路程表节点
typedef struct _outlink
{
	int node;
	struct _outlink* link;
} outlink;

//图对象
class graph
{
private:
	edgenode** edgelist;//保存路径信息
	vexnode* vexlist;//保存地名信息
	int n;//保存地点个数
	bool readdata(string filename);//读取数据文件函数
public:
	graph();
	~graph();
	bool creatgraph(string filename);//路径计算函数
	bool search(string start,string end);//查询函数
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -