cycle in undirected
class Solution {
public boolean isCyclic(int V, int[][] edges) {
// Create adjacency list
List<List<Integer>> adj = new ArrayList<>();
for(int i = 0; i < V; i++) {
adj.add(new ArrayList<>());
}
...
yesamitsingh.hashnode.dev1 min read