From 6aeb9dd78bb4ffab2baf6cbddf32bbeeecbaf7c7 Mon Sep 17 00:00:00 2001 From: SIDDHARTH PANDEY <56592079+siddharth25pandey@users.noreply.github.com> Date: Wed, 9 Jun 2021 19:31:11 +0530 Subject: [PATCH] Updated Dfs.cpp previous code was not working --- DfsCpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DfsCpp b/DfsCpp index 4c63dc1..bd82d49 100644 --- a/DfsCpp +++ b/DfsCpp @@ -15,8 +15,8 @@ class Solution { public: vectordfsOfGraph(int V, vector adj[]){ vector storeDfs; - vector vis(V+1, 0); - for(int i = 1;i<=V;i++) { + vector vis(V, 0); + for(int i = 0;i