diff --git a/BFS.cpp b/BFS.cpp index 0ce7460..954ff11 100644 --- a/BFS.cpp +++ b/BFS.cpp @@ -23,6 +23,7 @@ } int idx_s = s-1; found[idx_s] = true; + dist[idx_s] = 0; //initialize queue holding only s in the beginning