Skip to content

Commit 305a078

Browse files
Update DFS_Recursive.java
1 parent c2c2342 commit 305a078

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DepthFirstSearch/Java/DFS_Recursive.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public static void main(String[] args) {
4040
int u = in.nextInt();
4141
int v = in.nextInt();
4242
// Assuming that it's an undirected graph
43-
AdjList[x].add(y);
44-
AdjList[y].add(x);
43+
AdjList[u].add(v);
44+
AdjList[v].add(u);
4545
}
4646
System.out.println("Source node?");
4747
int source = in.nextInt();

0 commit comments

Comments
 (0)