diff options
| author | Paul Jungeblut <s_jungeb@i08pc55.atis-stud.uni-karlsruhe.de> | 2014-11-24 15:17:03 +0100 |
|---|---|---|
| committer | Paul Jungeblut <s_jungeb@i08pc55.atis-stud.uni-karlsruhe.de> | 2014-11-24 15:17:03 +0100 |
| commit | 544bc5e51b1176acc995ec434a9ab1bec401bc45 (patch) | |
| tree | 838ac6eb8bb51f745bda1b40f1761c4228bba49c /graph | |
| parent | f201d8cbb514802529d9a2f3024a258600d46aaa (diff) | |
| parent | fe77a131a5e6542662a3b9f61a0d787c5b15e844 (diff) | |
Merge branch 'master' of https://github.com/pjungeblut/ChaosKITs
merge
g Bitte geben Sie eine Commit-Beschreibung ein um zu erklären, warum dieser
Diffstat (limited to 'graph')
| -rw-r--r-- | graph/dijkstra.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/graph/dijkstra.cpp b/graph/dijkstra.cpp index e7ec0c3..92df955 100644 --- a/graph/dijkstra.cpp +++ b/graph/dijkstra.cpp @@ -5,16 +5,16 @@ dist[0] = 0; pq.push(ii(0, 0)); while (!pq.empty()) { - di front = pq.top(); pq.pop(); + ii front = pq.top(); pq.pop(); int curNode = front.second, curDist = front.first; if (curDist > dist[curNode]) continue; - for (i = 0; i < (int)adjlist[curNode].size(); i++) { + for (int i = 0; i < (int)adjlist[curNode].size(); i++) { int nextNode = adjlist[curNode][i].first, nextDist = curDist + adjlist[curNode][i].second; if (nextDist < dist[nextNode]) { dist[nextNode] = nextDist; pq.push(ii(nextDist, nextNode)); } } -}
\ No newline at end of file +} |
