I have a graph G containing N nodes and E edges.Each edge is undirectional.The goal is to find the no. of crucial nodes.
A node which makes the graph disconnected when it is removed is called a crucial node. The goal is to find the no. of such nodes in the graph.
A solution would be:-
For each node belonging to the graph, remove it from the graph, pick a node from the remaining graph, perform dfs, if we are able to reach everywhere then it is not a crucial node.
This solution is O(N*E) or worst case O(N^3).
Is there a O(N^2) solution or O(E) solution because N^3 is a bit too slow.