//本文件是图的邻接矩阵的头文件,使用C++模板类封装(This file is the header file of adjacency matrix of graph,and packed by C++ template class)
#ifndef MGRAPH_H
#define MGRAPH_H
#include <iostream>
#include "SeqList.h" //“SeqList.h”为我的博客里的一片文章,同在“证明我学过数据结构的痕迹”分类里
using namespace std;
#define MAXINT 1<<32-1
const int MaxGraphSize=1;
template <class T>
class MGraph
{
public:
//Constructor
MGraph(void);
//Data access functions
int NumberOfVertices(void) const;
int GetWeight(const T& vertex1,const T& vertex2);
int GetFirstNeighbor(const int v);
int GetNextNeighbor(const int v1,const int v2);
SeqList<T> GetVertex(int v);
SeqList<T>& GetNeighbors(const T& vertex);
//The update funtion of graph
void InsertVertex(const T& vertex);
void InsertEdge(const T& vertex1,const T& vertex2,int weight);
void DeleteVertex(const T& vertex);
void
Adjacency Matrix of Graph(图的邻接矩阵)
最新推荐文章于 2022-01-17 11:16:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)