Be the first user to complete this post

Add to List 
Check if given an edge is a bridge in the graph
Objective  Given a graph and an edge, write a program to check if the edge is a bridge.
Bridge in Graph: An edge is called a bridge if connects two subgraphs and removing the edge will disconnect the graph.
In this article, we will take the Graph represented by Adjacency List.
Example:
Approach: DepthFirst Search(DFS)
 Do the DFS to count the number of connected components (If the graph is fully connected then count would be 1).
 Remove the given edge.
 Do the DFS again and count the number of connected components, if the count is the same then given edge is not a bridge. If count is increased by 1 then given edge is a bridge.
Complete Code:
Output:
Given Edge (01) is not a BRIDGE  Given Edge (34) is not a BRIDGE  Given Edge (23) is a BRIDGE 
Also Read: