We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46f423c commit b796161Copy full SHA for b796161
dynamic_programming/floyd_warshall.cpp
@@ -1,6 +1,7 @@
1
#include <climits>
2
#include <iostream>
3
#include <string>
4
+#include <vector>
5
6
using std::cin;
7
using std::cout;
@@ -53,7 +54,7 @@ void print(int dist[], int V) {
53
54
// to all other vertices using Floyd-Warshall Algorithm.
55
void FloydWarshall(Graph graph) {
56
int V = graph.vertexNum;
- int dist[V][V];
57
+ std::vector<std::vector<int> > dist(V, std::vector<int>(V));
58
59
// Initialise distance array
60
for (int i = 0; i < V; i++)
0 commit comments