代码来自:。
graph.h文件内容如下:
#include#include #include #include #include
#include
本文共 5448 字,大约阅读时间需要 18 分钟。
代码来自:。
graph.h文件内容如下:
#include#include #include #include #include
#include
#includeVertex::Vertex(int v){}bool Vertex::addAdjVertex(int v) {}list order;bool operator==(Vertex const &v1, Vertex const &v2){ return true;}bool operator<(Vertex const &v1, Vertex const &v2){ return true;}bool operator>(Vertex const &v1, Vertex const &v2){ return true;}Edge::Edge(int a, int s1, int s2){ weight = a; src = s1; dst = s2;}int Edge::getWeight(){return weight;}int Edge::getSource(){return src;}int Edge::getDest(){return dst;}bool operator==( Edge const &e1, Edge const & e2){ if(e1.weight==e2.weight && e1.src==e2.src && e1.dst == e2.dst) return true; return false;}Graph::Graph(){}bool Graph::addVertex(int v){ list adjList; vertices.insert(pair
转载于:https://www.cnblogs.com/tigerisland/p/7564714.html