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

📄 algraph.h

📁 图中的拓扑排序文件已打包好
💻 H
字号:
// 有向图
#ifndef ALGraph_H
#define ALGraph_H

#include <vector>
#include <string>
#include <iostream>
#include <stack>
using namespace std;

struct Edge
{ int v1,v2;
  double weight;
};

struct ArcNode
{ int adjvex;
  double weight;
  ArcNode *nextarc;
};

template<class T>
struct VexNode
{ T data;
  ArcNode *firstarc;
};

template<class T>
class ALGraph
{ int m_N;
	vector<VexNode<T> > m_Data;
public:
  ALGraph(vector<T> vs);
  ~ALGraph();
  void Append(vector<Edge> &es);
  void Output();
	bool TopoSort(vector<T> & topo);
private:
  void Clear(ArcNode *head);
};

#endif

⌨️ 快捷键说明

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