From 2ba5fc0b83d00d0e0940e948d9ca9e5026042410 Mon Sep 17 00:00:00 2001 From: Anupam Dubey <59842200+anupamdubey8823@users.noreply.github.com> Date: Thu, 17 Jun 2021 20:34:16 +0530 Subject: [PATCH] Update djisktraCPP The code was not running for nodes other than adjacent nodes from the source node. Because we are taking input from 0-indexed but later printing as 1-indexed. --- djisktraCPP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djisktraCPP b/djisktraCPP index c06b9aa..ce1072e 100644 --- a/djisktraCPP +++ b/djisktraCPP @@ -7,7 +7,7 @@ int main(){ vector > g[n+1]; // 1-indexed adjacency list for of graph int a,b,wt; - for(int i = 0; i> a >> b >> wt; g[a].push_back(make_pair(b,wt)); g[b].push_back(make_pair(a,wt));