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

📄 gnode.h

📁 贪婪算法合集,包括二分覆盖,单源最短路径,拓扑排序,机器调度问题
💻 H
字号:

#ifndef GraphNode_
#define GraphNode_

#include<iostream>
using namespace std;

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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -