Skip to content

Commit fb3cec0

Browse files
renjianchengsiriak
andauthored
Fix a bug in A_Star.Graph in jdk17 (TheAlgorithms#2842)
Co-authored-by: Andrii Siriak <siryaka@gmail.com>
1 parent 6c00bee commit fb3cec0

File tree

1 file changed

+1
-1
lines changed
  • src/main/java/com/thealgorithms/datastructures/graphs

1 file changed

+1
-1
lines changed

src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private static class Graph {
1616
public Graph(int size) {
1717
this.graph = new ArrayList<>();
1818
for (int i = 0; i < size; i++) {
19-
this.graph.set(i, new ArrayList<>());
19+
this.graph.add(new ArrayList<>());
2020
}
2121
}
2222

0 commit comments

Comments
 (0)