Function to perform the DFS Traversal to find the count of connected components
adj = [ ] NEW_LINE visited = [ ] NEW_LINE num = 0 NEW_LINE def dfs ( v ) : NEW_LINE INDENT global adj , visited , num NEW_LINE DEDENT