DFS Function

PHOTO EMBED

Wed Jun 26 2024 15:03:42 GMT+0000 (Coordinated Universal Time)

Saved by @ayushg103 #c++

 void dfs(int node, vector<int> adjLs[], int vis[]) {
        // mark the more as visited
        vis[node] = 1; 
        for(auto it: adjLs[node]) {
            if(!vis[it]) {
                dfs(it, adjLs, vis); 
            }
        }
    }
content_copyCOPY