CPP || Using Tarjans algorithm for bridge || FULL EXPLANATION
This problem can be solved using TARJANS ALGORITHM for BRIDGES\n\nAccording to problem statment we have print all critical connections \nlets understand what\'s
This problem can be solved using **TARJANS ALGORITHM for BRIDGES**\n\nAccording to problem statment we have print all critical connections \nlets understand what\'s critical connections are:--\n![image](https://assets.leetcode.com/users/images/d1f570e2-d627-479c-b50e-dd0f843333cc_1652836616.8575888.jpeg)\nin above example *(1,2)* is not a critical connection bcz if we cut connection from 1 to 2 still we can reach from 1to 2\nvia (1->3->2) ,but if we cut connection from (1 to 4) we can\'t able to reach for 4 anymore so (1,4) will be critical connection.\n\nIn order to solve this problem we only need to\n1. Form Adjacency list\n2. Apply TARJANS ALGO\n\n**Code Implementation** \n\n```\nclass Solution {\n    unordered_map<int,vector<int>> adj; //Adj list\n    void DFS(int u,vector<int>& disc,vector<int>& low,vector<int>& parent,vector<vector<int>>& bridges)\n    {\n        static int time = 0;    //timestamp\n        disc[u] = low[u] = time;\n        time +=1;\n        \n        for(int v: adj[u])\n        {\n            if(disc[v]==-1) //If v is not visited\n            {\n                parent[v] = u;\n                DFS(v,disc,low,parent,bridges);\n                low[u] = min(low[u],low[v]);\n                \n                if(low[v] > disc[u])\n                    bridges.push_back(vector<int>({u,v}));\n            }\n            else if(v!=parent[u])   //Check for back edge\n                low[u] = min(low[u],disc[v]);\n        }\n    }\n    void findBridges_Tarjan(int V,vector<vector<int>>& bridges)\n    {\n        vector<int> disc(V,-1),low(V,-1),parent(V,-1);\n        //Apply DFS for each component\n        for(int i=0;i<V;++i)\n            if(disc[i]==-1)\n                DFS(i,disc,low,parent,bridges);\n    }\npublic:\n    vector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {\n        for(int i=0;i<connections.size();++i)   //Make Adj list (step 1)\n        {\n            adj[connections[i][0]].push_back(connections[i][1]);\n            adj[connections[i][1]].push_back(connections[i][0]);\n        }\n        \n        vector<vector<int>> bridges; //Store all the bridges as pairs\n        findBridges_Tarjan(n,bridges); //step 2(applying TARJANS AlGO)\n        return bridges;\n    }\n};\n```
['C++']