Having trouble with my edgeSet() and BFS(int start) methods.Anyone know what I am doing wrong?
public ArrayList<Edge> edgeSet()
{
ArrayList<Edge> edges = newArrayList<Edge>();
Edge placeHold = newEdge(0,0);
for(int i = 0; i <adjacencyMatrix.length; i++)
{
for(int j = 0; j< adjacencyMatrix.length; j++)
{
if(adjacencyMatrix[i][j] != 0)
{
placeHold.setStartVertex(i);
placeHold.setEndVertex(j);
edges.add(placeHold);
}
}
}
return edges;
}
public ArrayList<Edge> BFS(int start)
OR
OR