C++ || DFS || Easy Solution || 88%
\'\'\'\nclass Solution {\npublic:\n    \n    void DFS(vector>& graph, vector &visited,int v)\n    {\n        visited[v] = true; //marking visited;\n        \n  
\'\'\'\nclass Solution {\npublic:\n    \n    void DFS(vector<vector<int>>& graph, vector<bool> &visited,int v)\n    {\n        visited[v] = true; //marking visited;\n        \n        //now check for its neighbors\n        for(int i=0;i<graph[v].size();i++)\n        {\n            if(i == v)\n                continue;\n            \n            if(graph[v][i] && !visited[i])\n                DFS(graph,visited,i);\n        }\n        \n    }\n    \n    int findCircleNum(vector<vector<int>>& graph) \n    {\n        int n = graph.size();\n        \n        vector<bool> visited(n,false);\n        \n        int ans = 0;\n        for(int i=0;i<n;i++)\n        {\n            if(!visited[i])\n            {\n                DFS(graph,visited,i);\n                ans++;\n            }\n        }\n        return ans;\n        \n        \n    }\n};\n\'\'\'\n
['Depth-First Search', 'Graph', 'C']