Build an adjacency list from the connections.
Initialize disc[v] = -1 for all (unvisited marker), low[v] = 0, , .
For each unvisited vertex, run DFS:
- Set
disc[v] = low[v] = timer, - For each neighbor : if unvisited, recurse and update
low[v]; if visited (not parent), updatelow[v]withdisc[w] - If
low[w] > disc[v], add to result
Return result.
This runs in time and uses space.