Question: Data Structures c++ I need help implementing a weighted adjacency list graph with the following methods. It must be a weighted adjacency list. I haven't

Data Structures c++

I need help implementing a weighted adjacency list graph with the following methods. It must be a weighted adjacency list. I haven't been able to find any good resources online to help me with this, so your help would be appreciated.

class Graph { private: ??? public: Graph(); // constructor must NOT have an input void insertVertex(int vertex); //inserts new vertex in graph void insertEdge(int from, int to, int weight); //inserts new edge in graph bool isEdge(int from, int to); //returns true if there is an edge between the vertices from and to int getWeight(int from, int to); //returns the weight of the edge between the vertices from and to vector getAdjacent(int vertex); //return an array of integers representing vertices adjacent to vertex };

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!