Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit eaf2ec1

Browse files
committed
Make Prim's algorithm work correctly on list
1 parent cacda5f commit eaf2ec1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

UndirectedGraph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ string UndirectedGraph::primsAlgorithmOnList() {
266266
foundVertices.push_back(edgeEnd);
267267

268268
minimumSpanningTree[vertexID].push_front({edgeEnd, edgeValue});
269+
minimumSpanningTree[edgeEnd].push_front({vertexID, edgeValue});
269270

270271
vertexID = edgeEnd;
271272
j++;

0 commit comments

Comments
 (0)