View Single Post
Old Nov 5th, 2006, 1:59 PM   #10
deanosrs
Programmer
 
deanosrs's Avatar
 
Join Date: Apr 2006
Location: Bristol, UK
Posts: 31
Rep Power: 0 deanosrs is on a distinguished road
Send a message via MSN to deanosrs
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.
Attached Files
File Type: zip Cwk2ProblemX.zip (990 Bytes, 14 views)
deanosrs is offline   Reply With Quote