Skip to content

Commit 8317b78

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 038d30a commit 8317b78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

data_structures/Prim’s-Algorithm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import heapq
22

3+
34
def prim_mst(graph, start=0):
45
visited = set()
56
mst = []
@@ -29,7 +30,7 @@ def prim_mst(graph, start=0):
2930
1: [(0, 2), (2, 3), (3, 8), (4, 5)],
3031
2: [(1, 3), (4, 7)],
3132
3: [(0, 6), (1, 8)],
32-
4: [(1, 5), (2, 7)]
33+
4: [(1, 5), (2, 7)],
3334
}
3435

3536
mst, cost = prim_mst(graph)

0 commit comments

Comments
 (0)