bridges, tried to explain. [C++]
\nWhat we have been asked is to find bridges and we have been given edges.\nSo, first we just have to make bi-directional graph.\nsecond we will need three arra
```\nWhat we have been asked is to find bridges and we have been given edges.\nSo, first we just have to make bi-directional graph.\nsecond we will need three arrays,\none will store time for firstTime we see that node,\nsecond we will have arr where we store minimumTime needed to reach that node. \nThird is the visited array.\nNow after we have made the graph we will call dfs on first node, i.e. 0.\nIn our dfs fn, we will insert value in array of both firstTime, and minTime for that node,\nand increase the time. So now we know with every dfs time will increase and we will mark that node visited.\nNow we will go to every neighbour of that node, in the graph, nbr or child or whatever u want to call it.\nwe have three conditions only.\nnbr == parent, move to next iteration should not call dfs again or \nwe won\'t have anything in our answer, we will just be calling our parent and child again and again in timeless loop.\nif it hasn\'t been visited we call dfs and pass, the nbr as the node, and its parent as our initial node.\nNow we update minTime from what we have got from child and check if minTime of nbr is\ngreater than firstTime of node, if it is true, it means this is our bridge. ans we insert it in our ans array. That is all it to bridges.\n```\n    vector<vector<int>> ans, graph;\n    vector<int> firstTime, minTime, vis;\n    int time;\n    vector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {\n\t    time = 0;\n        firstTime.resize(n), minTime.resize(n), vis.resize(n), graph.resize(n);\n        for(vector<int>& edge : connections){\n            int u = edge[0], v = edge[1];\n            graph[v].push_back(u);\n            graph[u].push_back(v);\n        }\n        dfs(0);\n        return ans;\n    }\n    void dfs(int node, int parent = -1){\n        firstTime[node] = minTime[node] = time++;\n        vis[node] = 1;\n        for(int nbr : graph[node]){\n            if(nbr == parent) continue;\n            if(!vis[nbr]) dfs(nbr, node);\n            //the main two condition one is to update minTime and\n\t\t\t//second is to check if it is a bridge.\n            minTime[node] = min(minTime[node], minTime[nbr]);\n            if(firstTime[node] < minTime[nbr]) ans.push_back({node, nbr});\n        }\n    }\n```
['Depth-First Search', 'C']