C++,TC- O(N+E)
\n\nclass Solution {\npublic:\n  bool vis[100005];\n   int timer=0; // to mark the first visiting time of the node\n   vector adj[100005];\n  vectorans;\nvoid d
```\n\n```class Solution {\npublic:\n  bool vis[100005];\n   int timer=0; // to mark the first visiting time of the node\n   vector adj[100005];\n  vector<vector>ans;\nvoid dfs(int node,vector&in,vector&low,int par)\n{\n   vis[node]=true;\n   in[node]=low[node]=++timer;\n   for(int child:adj[node])\n     {\n       if(child==par) continue;\n       if(vis[child]==1)\n         {\n           low[node]=min(low[node],in[child]);\n          }\n     else\n       {\n       dfs(child,in,low,node);\n       if(low[child]>in[node]) // condition for existence of bridge\n        {\n         ans.push_back({node,child});\n          // cout<<node<<"-"<<child<<" is a bridge"<<endl;\n        }\n       else\n         low[node]=min(low[node],low[child]); // update the low time of node after returning back\n        }\n    }\n}\nvector<vector<int>> criticalConnections(int n, vector<vector<int>>& c) {\n    \n    for(auto x:c)  // creating the adjacency list \n    {\n        adj[x[0]].push_back(x[1]);\n        adj[x[1]].push_back(x[0]);\n    }  \n    for(int i=0;i<n;i++)  // initializing all node unvisited\n    {\n       vis[i]=false;\n    }\n    vector<int>in(n,0),low(n,0);\n     dfs(0,in,low,-1);  // u can make dfs() call to any node. Here I started with 0.\n    return ans;\n}\n};
['Depth-First Search', 'Graph']