grmat.h

来自「经典c++程序的实现」· C头文件 代码 · 共 24 行

H
24
字号
typedef int* Edge;class Graph {                  // Graph class: Adjacency matrixpublic:  int* matrix;                 // The edge matrix  int numVertex;               // Number of vertices  int numEdge;                 // Number of edges  bool* Mark;                  // The mark array  Graph();                     // Constructor  ~Graph();                    // Destructor  int n();                     // Number of vertices for graph  int e();                     // Number of edges for graph  Edge first(int);             // Get the first edge for a vertex  bool isEdge(Edge);           // TRUE if this is an edge  Edge next(Edge);             // Get next edge for a vertex  int v1(Edge);                // Return vertex edge comes from  int v2(Edge);                // Return vertex edge goes to  int weight(int, int);        // Return weight of edge  int weight(Edge);            // Return weight of edge};bool createGraph(Graph&, FILE*);void Gprint(Graph&);

⌨️ 快捷键说明

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