#include using namespace std;  void dfs_helper(int u,                vector& adj,                bool visited[]){    if (visited[u])        return;      visited[u] = true;      for (auto v : adj[u]) {        if (!visited[v])            dfs_helper(v, adj, visited);    }}  void getTransposeGraph(    vector& adj,    vector& trans_adj){    for (int u = 0; u < adj.size(); u++) {        for (auto v : adj[u]) {            trans_adj[v].push_back(u);        }    }}  void initialize_visited(bool visited[], int n){    for (int u = 0; u < n; u++)        visited[u] = false;}  vector findAllMotherVertices(    vector& adj){    int n = adj.size();    bool […]

Continue Reading