The function takes the argument of the current node index, adjacency list (stored in vector of vectors in this example), and vector of boolean to keep track of which node has been visited.
void dfs(int node, vector<vector<int>>* graph, vector<bool>* visited) {
// check whethe...