public class AdjacencyListGraph<V extends Node> extends java.lang.Object implements Graph<V>
| Constructor and Description |
|---|
AdjacencyListGraph() |
AdjacencyListGraph(int d) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(V a,
V b) |
void |
addNode(V v) |
boolean |
adjacent(V a,
V b) |
int |
degree(V v) |
java.util.Collection<V> |
getNeighbors(V v) |
void |
removeEdge(V a,
V b) |
void |
removeNode(V v) |
int |
sizeVertices() |
public AdjacencyListGraph()
public AdjacencyListGraph(int d)
public void removeNode(V v)
removeNode in interface Graph<V extends Node>public void removeEdge(V a, V b)
removeEdge in interface Graph<V extends Node>public java.util.Collection<V> getNeighbors(V v)
getNeighbors in interface Graph<V extends Node>public int sizeVertices()
sizeVertices in interface Graph<V extends Node>