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
This commit is contained in:
Chen Ostrovski
2021-03-26 14:27:16 +03:00
committed by GitHub
parent 2163204d8c
commit 67cb97df82

View File

@ -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;
}