Skip to content

Commit af77abf

Browse files
authored
Update 7.py
1 parent 58052fe commit af77abf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

10/7.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def union_parent(parent, a, b):
1616

1717
# 노드의 개수와 간선(Union 연산)의 개수 입력 받기
1818
v, e = map(int, input().split())
19-
parent = {}
19+
parent = [0] * (v + 1) # 부모 테이블 초기화하기
2020

2121
# 모든 간선을 담을 리스트와, 최종 비용을 담을 변수
2222
edges = []
@@ -34,7 +34,7 @@ def union_parent(parent, a, b):
3434

3535
# 간선을 비용순으로 정렬
3636
edges.sort()
37-
last = 0
37+
last = 0 # 최소 신장 트리에 포함되는 간선 중에서 가장 비용이 큰 간선
3838

3939
# 간선을 하나씩 확인하며
4040
for edge in edges:

0 commit comments

Comments
 (0)