Question: C++ The file UnGraph.cpp contains the code for defining an undirected graph . Use this file to write a program to create a minimum spanning
C++
The file UnGraph.cpp contains the code for defining an undirected graph. Use this file to write a program to create a minimum spanning tree according the Kruskal algorithm. Print the tree. Then, find those couple of vertices, among which are the edges with the minimum and the maximum value (weight). Print those vertices and the weight of the edges between them, and then check whether there is a path between those vertices in the minimum spanning tree.
The file UnGraph.cpp
Example output:
#include
#include
#include
using namespace std;
int main() {
string input;
stack
queue
cout
cin >> input;
for (int i = 0; i
if (islower(input[i])) {
s.push(input[i]);
}
else {
q.push(input[i]);
}
}
cout
while (!s.empty()) {
cout ";
s.pop();
}
cout
cout
while (!q.empty()) {
cout ";
q.pop();
}
cout
while (!s.empty()) {
q.push(s.top());
s.pop();
}
cout
cout
cout
while (!q.empty()) {
cout ";
q.pop();
}
cout
return 0;
}
Example Output :

The graph g
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
