class Graph
{
protected:
size_t numVertex = 0, numEdge = 0;
public:
virtual size_t n() = 0; //返回顶点数
virtual size_t e() = 0; //返回目前的边数
virtual int first(size_t ) = 0; //返回第一个neighbour
virtual int next(size_t, size_t ) = 0; //返回第2个neighbour
virtual void setEdge(size_t v1, size_t v2, int weight); // =0 =0 =0 =0 =0 =0 =0 =0 =0 =0
virtual void delEdge(size_t v1, size_t v2); // =0 =0 =0 =0 =0 =0 =0 =0 =0 =0
virtual int weight(size_t v1, size_t v2) = 0; //返回两点之间距离
virtual bool getMark(size_t v) = 0; //返回指定顶点的标记值
};
{
protected:
size_t numVertex = 0, numEdge = 0;
public:
virtual size_t n() = 0; //返回顶点数
virtual size_t e() = 0; //返回目前的边数
virtual int first(size_t ) = 0; //返回第一个neighbour
virtual int next(size_t, size_t ) = 0; //返回第2个neighbour
virtual void setEdge(size_t v1, size_t v2, int weight); // =0 =0 =0 =0 =0 =0 =0 =0 =0 =0
virtual void delEdge(size_t v1, size_t v2); // =0 =0 =0 =0 =0 =0 =0 =0 =0 =0
virtual int weight(size_t v1, size_t v2) = 0; //返回两点之间距离
virtual bool getMark(size_t v) = 0; //返回指定顶点的标记值
};