From baeec35b33919762a6d1ad1bd1477eb4b749861d Mon Sep 17 00:00:00 2001 From: wisdompeak Date: Wed, 19 Apr 2023 19:48:45 -0700 Subject: [PATCH] Create 2642.Design-Graph-With-Shortest-Path-Calculator.cpp --- ...gn-Graph-With-Shortest-Path-Calculator.cpp | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Graph/2642.Design-Graph-With-Shortest-Path-Calculator/2642.Design-Graph-With-Shortest-Path-Calculator.cpp diff --git a/Graph/2642.Design-Graph-With-Shortest-Path-Calculator/2642.Design-Graph-With-Shortest-Path-Calculator.cpp b/Graph/2642.Design-Graph-With-Shortest-Path-Calculator/2642.Design-Graph-With-Shortest-Path-Calculator.cpp new file mode 100644 index 000000000..04cfb1a13 --- /dev/null +++ b/Graph/2642.Design-Graph-With-Shortest-Path-Calculator/2642.Design-Graph-With-Shortest-Path-Calculator.cpp @@ -0,0 +1,44 @@ +class Graph { + int n; + int dp[100][100]; +public: + Graph(int n, vector>& edges) { + this->n = n; + for (int i=0; i edge) + { + int a = edge[0], b = edge[1]; + for (int i=0; iaddEdge(edge); + * int param_2 = obj->shortestPath(node1,node2); + */