protected LinkedList[] createAdjacentLinkedListGraph(int n,int[][]edges){
        LinkedList[] adjacentList=new LinkedList[n];
        for(int i=0;i<n;++i) adjacentList[i]=new LinkedList();
        for(int i=0;i<edges.length;++i){
            adjacentList[edges[i][0]].add(edges[i][1]);
            adjacentList[edges[i][1]].add(edges[i][0]);
        }
        return adjacentList;
    }