摘要:
namespace DSList{ //有向图邻接矩阵类(Directed Graph Adjacency Matrix Class) public class DireGraAdjMatrix<T> : IDireGraph<T> { //Fields private GvNode<T>[] nodes; private int numArcs; private int[,] matrix; //Constructor public DireGraAdjMatrix(int n) { nodes = new GvNode<T>[n]; numA 阅读全文
摘要:
namespace DSList{ //有向图邻接表类(Directed Graph Adjacency List Class) public class DireGraAdjList<T> : IDireGraph<T> { private ALVexNode<T>[] adjList; public ALVexNode<T> this[int index] { get { return adjList[index]; } set { adjList[index] = value; } } publi... 阅读全文
摘要:
namespace DSList{ //有向图接口类 public interface IDireGraph<T> { int GetNumOfVertex(); //获取顶点的数目 int GetNumOfArc(); //获取弧的数目 bool IsGvNode(GvNode<T> v); //v是否为图的顶点 int GetIndex(GvNode<T> v); //获得顶点V在顶点数组中的索引 void SetArc(GvNode<T> v1, GvNode<T> v2, int v); //在顶点v1和v2之间添加权值为v的 阅读全文