Skip to content

Commit f8d82ea

Browse files
authored
Update 2.py
1 parent fbfe683 commit f8d82ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

9/2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
graph[a].append((b, c))
2020

2121
def dijkstra(start):
22-
q = []
23-
# 시작 노드로 가기 위한 최단 경로는 0으로 설정하여, 큐에 삽입합니다.
24-
heapq.heappush(q, (0, start))
25-
distance[start] = 0
26-
while q: # 큐가 비어있지 않다면
22+
q = []
23+
# 시작 노드로 가기 위한 최단 경로는 0으로 설정하여, 큐에 삽입합니다.
24+
heapq.heappush(q, (0, start))
25+
distance[start] = 0
26+
while q: # 큐가 비어있지 않다면
2727
# 가장 최단 거리가 짧은 노드에 대한 정보를 꺼냅니다.
2828
dist, now = heapq.heappop(q)
2929
# 현재 노드가 이미 처리된 적이 있는 노드라면 무시합니다.

0 commit comments

Comments
 (0)