From 67cb97df82f3b95c7077f373633ebcb31913b1dc Mon Sep 17 00:00:00 2001 From: Chen Ostrovski Date: Fri, 26 Mar 2021 14:27:16 +0300 Subject: [PATCH] Fix 2D array passed to Arrays.fill() (#2010) 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 017d0cd4a..8a4ae5d96 100644 --- a/DataStructures/Graphs/FloydWarshall.java +++ b/DataStructures/Graphs/FloydWarshall.java @@ -14,7 +14,7 @@ public class FloydWarshall { [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; }