gnode.h

来自「data structures, algorithms and Applicat」· C头文件 代码 · 共 29 行

H
29
字号

#ifndef GraphNode_
#define GraphNode_

template <class T> class LinkedWDigraph;
template <class T> class LinkedWGraph;
template <class T> class Chain;

template <class T>
class GraphNode {
   friend LinkedWDigraph<T>;
   friend LinkedWGraph<T>;
   friend Chain<T>;
   public:
      int operator !=(GraphNode<T> y) const
      {return (vertex != y.vertex);}
      void Output(ostream& out) const
      {out << vertex << " " << weight << " ";}
   private:
      int vertex;  // second vertex of edge
      T weight;    // edge weight
};

template <class T>
ostream& operator<<(ostream& out, GraphNode<T> x)
   {x.Output(out); return out;}

#endif

⌨️ 快捷键说明

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