int prims_algo() { int n; cout<<"\nEnter the total number of offices in all cities :- "<<endl; //Accept the cost matrix cin>>n; int cost_mat[n][n]; cout<<"\nEnter the cost of telephone lines between ...
This code implements Prim's algorithm to find the Minimum Spanning Tree (MST) of a given graph. The graph is represented as a 2D array graph with V vertices, where V is defined as a constant V. The ...