这是我的构造函数,我想问一下,这是否等同于web图的整体外观? 我只是制作一个2D数组,其中(我认为)所有的凹凸都是顶点,一个顶点连接2个或更多其他的椎体(凹凸)。我是对的吗?
Graph:: Graph (int numVertices) {
this -> numVertices = numVertices;
//memory alocated for elements of rows.
adjMatrix = new double*[numVertices];
//memory allocated for elements of each column
for(int i =0; i < numVertices; i++)
adjMatrix[i] = new double[numVertices];
for(int i =0; i < numVertices; i++)
for (int j=0; j< numVertices; j++)
adjMatrix[i][j] = INFINITY;
}