This commit is contained in:
krahets
2023-06-16 21:22:44 +08:00
parent 3881f13deb
commit 79f6055e8b
5 changed files with 399 additions and 37 deletions

View File

@@ -155,7 +155,7 @@ comments: true
// 向顶点列表中添加新顶点的值
vertices.push_back(val);
// 在邻接矩阵中添加一行
adjMat.emplace_back(n, 0);
adjMat.emplace_back(vector<int>(n, 0));
// 在邻接矩阵中添加一列
for (vector<int> &row : adjMat) {
row.push_back(0);