Given an undirected Connected graph of V vertices and E edges. A critical connection is an edge that, if removed, will make some nodes unable to reach some other nodes. Find all critical connections in the graph. Note: There are many possible orders for the answer. You are supposed to print the edges in sorted order, and also an edge should be in sorted order too. So if there's an edge between node 1 and 2, you should print it like (1,2) and not (2,1).
Both the edges in the graph are Crtical
The edge between nodes 2 and 3 is the only
Critical connection in the given graph.
You don’t need to read input or print anything. Your task is to complete the function criticalConnections() which takes the integer V denoting the number of vertices and an adjacency list adj as input parameters and returns a list of lists containing the Critical connections in the sorted order.
Expected Time Complexity: O(V + E) Expected Auxiliary Space: O(V)