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 GRAPHINTERFACE
#define GRAPHINTERFACE
Declare the template class GraphInterface
template
class GraphInterface
Access specifier
public:
Declare the method getNumVertices
virtual int getNumVertices const ;
Declare the method getNumEdges
virtual int getNumEdges const ;
Declare the method add to add the vertices
virtual void addLabelType start, LabelType end;
Declare the method remove to remove the vertices
virtual bool removeLabelType start, LabelType end;
Declare the method getEdgeWeight to get edge weight
virtual int getEdgeWeightLabelType start, LabelType end const ;
Declare the method display
virtual void display;
;
#endif
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
