From fb3cec06a1561d57b157ffa1cea990087e70628e Mon Sep 17 00:00:00 2001 From: R_juzi <59160257+R-juzi@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:29:38 +0800 Subject: [PATCH] Fix a bug in A_Star.Graph in jdk17 (#2842) Co-authored-by: Andrii Siriak --- .../java/com/thealgorithms/datastructures/graphs/A_Star.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java b/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java index 610b364b3..44f5eadaa 100644 --- a/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java +++ b/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java @@ -16,7 +16,7 @@ public class A_Star { public Graph(int size) { this.graph = new ArrayList<>(); for (int i = 0; i < size; i++) { - this.graph.set(i, new ArrayList<>()); + this.graph.add(new ArrayList<>()); } }