#include <GraphList.h>
Inheritance diagram for GraphList:
Public Member Functions | |
GraphList () | |
GraphList (int n) | |
~GraphList () | |
bool | isEdge (int, int) |
int | edgeWeight (int, int) |
void | addEdge (int u, int v, int w) |
Add edge to graph structure from (u,v). | |
bool | removeEdge (int u, int v) |
Remove edge, and if undirected, remove its opposite as well. | |
Protected Member Functions | |
void | allocate (int n) |
No special allocations. | |
void | deallocate () |
Deallocate by freeing the vertices. | |
Private Member Functions | |
void | helperRemove (int, int, bool) |
GraphList::GraphList | ( | ) | [inline] |
GraphList::GraphList | ( | int | n | ) | [inline] |
GraphList::~GraphList | ( | ) | [inline] |
void GraphList::addEdge | ( | int | u, | |
int | v, | |||
int | w | |||
) |
Add edge to graph structure from (u,v).
If the graph is undirected, then we must add in reverse as well. It is up to user to ensure that no edge already exists. The check will not be performed here.
u | integer identifier of a vertex | |
v | integer identifier of a vertex | |
w | planned weight. |
Reimplemented from Graph.
void GraphList::allocate | ( | int | n | ) | [inline, protected] |
No special allocations.
void GraphList::deallocate | ( | ) | [inline, protected] |
Deallocate by freeing the vertices.
int GraphList::edgeWeight | ( | int | , | |
int | ||||
) |
void GraphList::helperRemove | ( | int | , | |
int | , | |||
bool | ||||
) | [private] |
bool GraphList::isEdge | ( | int | , | |
int | ||||
) |
bool GraphList::removeEdge | ( | int | u, | |
int | v | |||
) |
Remove edge, and if undirected, remove its opposite as well.
u | integer identifier of a vertex | |
v | integer identifier of a vertex |
Reimplemented from Graph.