Hi there! I need help with this C++ Program. If you have answered this question before or if you are going to copy-paste from other similar solution, please don't answer again! Thank you! QUESTION: Using C++, create a program with two functionalities: [1] Generate a Minimum Spaning Tree (MST) for strings with Prim's Algorithm. This method must have two input parameters: the origin node ("string start") and a Graph class for the MST (the main object Graph g, from which the MST will be generated, is the one who will call the method using g.PrimAlgo(string start, Graph agm)). This method should be implemented using a priority_queue with a pair, i.e. typedef pair p, priority_queue , greater > pq. The edges must be in a map. Consider all auxiliar methods (get edge weight) already implemented. If there is a tie between the weight of two edges (u1,v1) and (u2,v2), choose the one in which the value of u is the lowest.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hi there! I need help with this C++ Program.

If you have answered this question before or if you are going to copy-paste from other similar solution, please don't answer again! Thank you!

QUESTION: Using C++, create a program with two functionalities:

[1] Generate a Minimum Spaning Tree (MST) for strings with Prim's Algorithm. This method must have two input parameters: the origin node ("string start") and a Graph class for the MST (the main object Graph g, from which the MST will be generated, is the one who will call the method using g.PrimAlgo(string start, Graph agm)). This method should be implemented using a priority_queue with a <int, string> pair, i.e. typedef pair<int, string> p, priority_queue <p, vector<p>, greater<p> > pq. The edges must be in a map<string, Edge>. Consider all auxiliar methods (get edge weight) already implemented. If there is a tie between the weight of two edges (u1,v1) and (u2,v2), choose the one in which the value of u is the lowest.

[2] Recursively print the MST generated by Prim's Algorithm method. This tree must be represented using adjacency list.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Randomized Select Algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education