mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-06 17:29:31 +08:00
Fix a bug in A_Star.Graph in jdk17 (#2842)
Co-authored-by: Andrii Siriak <siryaka@gmail.com>
This commit is contained in:
@ -16,7 +16,7 @@ public class A_Star {
|
|||||||
public Graph(int size) {
|
public Graph(int size) {
|
||||||
this.graph = new ArrayList<>();
|
this.graph = new ArrayList<>();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
this.graph.set(i, new ArrayList<>());
|
this.graph.add(new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user