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

Function main

graph/code14.cpp:128–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128int main()
129{
130 int v = 7;
131 vector<pair<int, int>> adj[v];
132
133 // adding all edges now
134 add_edge(adj, 0, 1, 7);
135 add_edge(adj, 0, 3, 5);
136 add_edge(adj, 1, 3, 9);
137 add_edge(adj, 1, 2, 8);
138 add_edge(adj, 1, 4, 7);
139 add_edge(adj, 2, 4, 5);
140 add_edge(adj, 3, 4, 15);
141 add_edge(adj, 3, 5, 6);
142 add_edge(adj, 4, 5, 8);
143 add_edge(adj, 4, 6, 9);
144 add_edge(adj, 5, 6, 11);
145
146 // int v = 5;
147 // vector<pair<int, int>> adj[v];
148
149 // add_edge(adj, 0, 1, 5);
150 // add_edge(adj, 0, 2, 2);
151 // add_edge(adj, 1, 2, 4);
152 // add_edge(adj, 1, 4, 1);
153 // add_edge(adj, 2, 3, 6);
154 // add_edge(adj, 4, 3, 3);
155
156 prims_algo1(adj, v);
157
158 prims_algo2(adj, v);
159
160 return 0;
161}

Callers

nothing calls this directly

Calls 3

prims_algo1Function · 0.85
prims_algo2Function · 0.85
add_edgeFunction · 0.70

Tested by

no test coverage detected