From d805c074d080a84c98ac235da051c284833debdf Mon Sep 17 00:00:00 2001 From: ChenOst Date: Wed, 4 Nov 2020 17:18:18 +0000 Subject: [PATCH] Fix 2D array passed to Arrays.fill() Arrays.fill() accepts single dimensional arrays, so fill one row at a time. Fixes TheAlgorithms/Java#2009 --- DataStructures/Graphs/FloydWarshall.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataStructures/Graphs/FloydWarshall.java b/DataStructures/Graphs/FloydWarshall.java index 017d0cd4a56d..8a4ae5d96429 100644 --- a/DataStructures/Graphs/FloydWarshall.java +++ b/DataStructures/Graphs/FloydWarshall.java @@ -14,7 +14,7 @@ public FloydWarshall(int numberofvertices) { [numberofvertices + 1]; // stores the value of distance from all the possible path form the source // vertex to destination vertex - Arrays.fill(DistanceMatrix, 0); + // The matrix is initialized with 0's by default this.numberofvertices = numberofvertices; }