From 5e4567ba3abfe7806e5da2c0cae100bf887e53f7 Mon Sep 17 00:00:00 2001 From: iridiumR Date: Fri, 10 Dec 2021 00:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=AB=E5=90=8D=E5=85=B6=E5=A6=99=E5=B0=B1?= =?UTF-8?q?=E5=A5=BD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ex11/graph.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ex11/graph.hpp b/ex11/graph.hpp index aeb5fbb..089e281 100644 --- a/ex11/graph.hpp +++ b/ex11/graph.hpp @@ -53,7 +53,7 @@ class graphVertex { private: Vector *> V; - Vector *> E; + Vector *>> E; int v; int e; @@ -121,14 +121,14 @@ public: // 0 成功 virtual int link(int id1, int id2, int w) { - // if (V[id1] == NULL || V[id2] == NULL) - // return -1; - // if (E[id1][id2] != NULL) - // return -2; + if (V[id1] == NULL || V[id2] == NULL) + return -1; + if (E[id1][id2] != NULL) + return -2; V[id1]->outDegree++; V[id2]->inDegree++; Edge *temp = new Edge(w); - (E->_v[id1])->_v[id2] = temp; + (E._v[id1])._v[id2] = temp; return 0; } // 解除 id1->id2 连接