Skip to content

Commit e04f145

Browse files
committed
Fixes(#3359)
1 parent a653810 commit e04f145

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/thealgorithms/backtracking/All_Paths_From_Source_To_Target.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void addEdge(int u, int v)
5353

5454
// Prints all paths from 's' to 'd'
5555

56-
public void printAllPaths(int s, int d, int c)
56+
public void printAllPaths(int s, int d)
5757
{
5858
boolean[] isVisited = new boolean[v];
5959
ArrayList<Integer> pathList = new ArrayList<>();
@@ -62,7 +62,7 @@ public void printAllPaths(int s, int d, int c)
6262
pathList.add(s);
6363

6464
// Call recursive utility
65-
printAllPathsUtil(s, d, isVisited, pathList);
65+
printAllPathsUtil(s, d, isVisited, pathList,a);
6666
return a[0];
6767
}
6868

@@ -88,7 +88,7 @@ private int printAllPathsUtil(Integer u, Integer d, boolean[] isVisited, List<In
8888
if (!isVisited[i]) {
8989
// store current node in path[]
9090
localPathList.add(i);
91-
printAllPathsUtil(i, d, isVisited, localPathList);
91+
printAllPathsUtil(i, d, isVisited, localPathList,a);
9292

9393
// remove current node in path[]
9494
localPathList.remove(i);

0 commit comments

Comments
 (0)