I am declaring a LinkedList of LinkedLists of type GraphEdge as follows:
First declare LinkedList and fixed length (for global numVertices):
LinkedList[] adjList = new LinkedList[numVertices];
Then initialize each adjList[i] as a new LinkedList<GraphEdge>()
for (i = 0; i < this.numVertices; i++) {
adjList[i] = new LinkedList<GraphEdge>();
}
But I am getting an error when trying to call:
GraphEdge nextEdge = adjList[v].peekFirst();