Question: C + + . I m currently working on a visual studio project based on the below header file. The project is supposed to be

C++. Im currently working on a visual studio project based on the below header file. The project is supposed to be derived from GraphInterface.h and use an adjacency matrix to represent the graph, as well as an adjacency list to represent the graph, and allow the graph to be either weighted or unweighted and either directed or undirected. I would appreciate a practical example of this and I would greatly appreciate comments.
GraphInterface.h:
#ifndef _GRAPH_INTERFACE
#define _GRAPH_INTERFACE
//Declare the template class GraphInterface
template
class GraphInterface
{
//Access specifier
public:
//Declare the method getNumVertices()
virtual int getNumVertices() const =0;
//Declare the method getNumEdges()
virtual int getNumEdges() const =0;
//Declare the method add() to add the vertices
virtual void add(LabelType start, LabelType end)=0;
/*Declare the method remove() to remove the vertices*/
virtual bool remove(LabelType start, LabelType end)=0;
/*Declare the method getEdgeWeight() to get edge weight*/
virtual int getEdgeWeight(LabelType start, LabelType end) const =0;
//Declare the method display()
virtual void display()=0;
};
#endif

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 Accounting Questions!