Skip to content

Commit 67cb97d

Browse files
authored
Fix 2D array passed to Arrays.fill() (TheAlgorithms#2010)
Arrays.fill() accepts single dimensional arrays, so fill one row at a time. Fixes TheAlgorithms#2009
1 parent 2163204 commit 67cb97d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DataStructures/Graphs/FloydWarshall.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public FloydWarshall(int numberofvertices) {
1414
[numberofvertices
1515
+ 1]; // stores the value of distance from all the possible path form the source
1616
// vertex to destination vertex
17-
Arrays.fill(DistanceMatrix, 0);
17+
// The matrix is initialized with 0's by default
1818
this.numberofvertices = numberofvertices;
1919
}
2020

0 commit comments

Comments
 (0)