So I copy and pasted and it worked with the stuff from James' post... but since I've had to change my code and now it is doing it again! I've got a class called Edge now which just stores a destination node and the edge's weight. So my code is:
Quote:
ArrayList[] graph = new ArrayList[nodeno];
for (j = 0; j < nodeno; j++) graph[j] = new ArrayList<Edge>();
|
when initialising the array of arraylists (switched from linked lists!),
and when adding to it,
Quote:
addthis = new Edge(dest,weight);
graph[src - 1].add(addthis);
|
The full source is attached... I've got the same loop in though, so I can't see why I'm still getting the warning.