We will now define what a data structure representing a graph should do. Later, we will discuss the different implementations of this ADT. A graph must support the following operations:
Add Vertex: This adds a new vertex
Remove Vertex: This removes a vertex
Add edge: This adds a new edge; in our graph, we will allow a maximum of one edge between two vertices for simplicity
Remove edge: This removes an edge
Adjacent: This checks whether the two given vertices are adjacent to each other, that is, whether there is an edge between the given nodes
Neighbors: This returns a list of vertices that are adjacent to the given vertex
Get Vertex Value: This gets the value stored in a vertex
Set Vertex Value: This stores a value in a vertex
Get Edge Value: This gets the value stored in an edge
Set Edge Value: This sets the value stored in an edge
Is undirected: This returns whether the graph is undirected
Get all vertices: This returns a self-balancing binary search tree containing all the...