Skip to content

Commit ae0a62e

Browse files
Shreeja KarajagiShreeja Karajagi
Shreeja Karajagi
authored and
Shreeja Karajagi
committed
Fix type cast in AllPathsFromSourceToTarget.java
1 parent d23a0ec commit ae0a62e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public AllPathsFromSourceToTarget(int vertices) {
3030
}
3131

3232
// utility method to initialise adjacency list
33+
@SuppressWarnings("unchecked")
3334
private void initAdjList() {
34-
adjList = new ArrayList[v];
35+
adjList = (ArrayList<Integer>[])new ArrayList[v];
3536

3637
for (int i = 0; i < v; i++) {
3738
adjList[i] = new ArrayList<>();

0 commit comments

Comments
 (0)