Java: Trouble randomizing a DFS run to build a maze
问题 I'm having trouble randomizing the visit from a node to its neighbors, rarely is the whole graph (a MxN array, in this test 4x4) visited, I don't get what I'm doing wrong here. import java.util.ArrayList; class IJ { int i; int j; IJ (int i,int j){ i = this.i; j= this.j; } } class Graph { int M; int N; int adjacencyMatrix[][]; ArrayList <IJ> orderOfVisits; Graph(int M,int N){ this.M=M; this.N=N; adjacencyMatrix=new int[M][N]; for (int i=0; i<M; i++) for (int j=0;j<N;j++){ adjacencyMatrix[i][j]