Skip to content
Snippets Groups Projects
Commit 80635c2e authored by orestis.malaspin's avatar orestis.malaspin
Browse files

updated pseudocode

parent f0fe41a8
No related branches found
No related tags found
No related merge requests found
Pipeline #11818 passed
...@@ -68,7 +68,7 @@ void dijkstra(graph g, int src, int num, int dist[num], int prev[num]) { ...@@ -68,7 +68,7 @@ void dijkstra(graph g, int src, int num, int dist[num], int prev[num]) {
while (!queue_is_empty(q)) { while (!queue_is_empty(q)) {
p = queue_pop(q); p = queue_pop(q);
for v in the neighborhood of p { for v in the neighborhood of p {
d_new = dist[v] + distance(p, v); d_new = dist[v] + weight(p, v);
if (d_new < dist[v]) { if (d_new < dist[v]) {
dist[v] = d_new; dist[v] = d_new;
prev[v] = p; prev[v] = p;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment