0

これが私のコンストラクターです。質問したいのですが、これは Web グラフの全体的な外観と同等でしょうか? 私は(私が思うに)すべての指標が頂点であり、1つの頂点が2つ以上の他の頂点(指標)に結合する2D配列を作成しています。私は正しいですか?

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;
}
4

0 に答える 0