From 972e66299ae7a6287925736bcbf2b3701e9e98fe Mon Sep 17 00:00:00 2001 From: vamsi-98 Date: Sat, 9 Oct 2021 14:11:16 +0530 Subject: [PATCH] refactor(dfs-cpp): refactored the dfs function in cpp implementation --- DFS/cpp/dfs.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/DFS/cpp/dfs.cpp b/DFS/cpp/dfs.cpp index 60cb5801..93ec2fa8 100644 --- a/DFS/cpp/dfs.cpp +++ b/DFS/cpp/dfs.cpp @@ -22,15 +22,14 @@ void dfs(int node) visited[node] = true; // For all nodes adjacent to the given node and have not yet been visited, we apply DFS function again. - for(int i=0;i