Skip to content

Commit 4b761d4

Browse files
committed
Fixes(#3359)
1 parent 4fba735 commit 4b761d4

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public AllPathsFromSourceToTarget(int vertices)
3333
}
3434

3535
// utility method to initialise adjacency list
36-
37-
@SuppressWarnings("unchecked")
3836
private void initAdjList()
3937
{
4038
adjList = new ArrayList[v];
@@ -102,7 +100,7 @@ private int printAllPathsUtil(Integer u, Integer d, boolean[] isVisited, List<In
102100
}
103101

104102
// Driver program
105-
public static boolean all_Paths_From_Source_To_Target(int vertices, int a[][], int source, int destination, int num_of_paths)
103+
public static int[][] allPathsFromSourceToTarget(int vertices, int a[][], int source, int destination, int num_of_paths)
106104
{
107105
// Create a sample graph
108106
AllPathsFromSourceToTarget g = new AllPathsFromSourceToTarget(vertices);

src/test/java/com/thealgorithms/backtracking/AllPathsFromSourceToTargetTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void testForFirstCase() {
1414
int source = 2;
1515
int destination = 3;
1616
int num_of_paths = 3;
17-
assertTrue(AllPathsFromSourceToTarget.all_Paths_From_Source_To_Target (vertices,a,source,destination,num_of_paths));
17+
assertTrue(AllPathsFromSourceToTarget.allPathsFromSourceToTarget(vertices,a,source,destination,num_of_paths));
1818
}
1919

2020
@Test
@@ -24,7 +24,7 @@ void testForSecondCase() {
2424
int source = 0;
2525
int destination = 4;
2626
int num_of_paths = 6;
27-
assertTrue(AllPathsFromSourceToTarget.all_Paths_From_Source_To_Target (vertices,a,source,destination,num_of_paths));
27+
assertTrue(AllPathsFromSourceToTarget.allPathsFromSourceToTarget(vertices,a,source,destination,num_of_paths));
2828
}
2929

3030
@Test
@@ -34,7 +34,7 @@ void testForThirdCase() {
3434
int source = 1;
3535
int destination = 5;
3636
int num_of_paths = 2;
37-
assertTrue(AllPathsFromSourceToTarget.all_Paths_From_Source_To_Target (vertices,a,source,destination,num_of_paths));
37+
assertTrue(AllPathsFromSourceToTarget.allPathsFromSourceToTarget(vertices,a,source,destination,num_of_paths));
3838
}
3939

4040
@Test
@@ -44,6 +44,6 @@ void testForFourthcase() {
4444
int source = 0;
4545
int destination = 2;
4646
int num_of_paths = 2;
47-
assertTrue(AllPathsFromSourceToTarget.all_Paths_From_Source_To_Target (vertices,a,source,destination,num_of_paths));
47+
assertTrue(AllPathsFromSourceToTarget.allPathsFromSourceToTarget(vertices,a,source,destination,num_of_paths));
4848
}
4949
}

0 commit comments

Comments
 (0)