MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

graph/code16.cpp:107–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107int main()
108{
109 // int v = 5;
110 // vector<pair<int, int>> adj[v];
111
112 // add_edge(adj, 0, 1, 6);
113 // add_edge(adj, 0, 3, 1);
114 // add_edge(adj, 1, 3, 2);
115 // add_edge(adj, 3, 4, 1);
116 // add_edge(adj, 1, 4, 2);
117 // add_edge(adj, 1, 2, 5);
118 // add_edge(adj, 2, 4, 5);
119
120 // int source = 0;
121
122 int v = 5;
123 vector<pair<int, int>> adj[v];
124
125 add_edge(adj, 0, 1, 3);
126 add_edge(adj, 0, 2, 1);
127 add_edge(adj, 1, 2, 7);
128 add_edge(adj, 2, 3, 2);
129 add_edge(adj, 1, 3, 5);
130 add_edge(adj, 1, 4, 1);
131 add_edge(adj, 3, 4, 7);
132
133 int source = 2;
134
135
136 dijstra1(adj, v, source);
137 dijstra2(adj, v, source);
138 return 0;
139}

Callers

nothing calls this directly

Calls 3

dijstra1Function · 0.85
dijstra2Function · 0.85
add_edgeFunction · 0.70

Tested by

no test coverage detected