All pastes #406218 Raw Edit

Unnamed

public java v1 · immutable
·published 2007-03-22 06:14 UTC
rendered paste body
    public void removeEdge(int v, int w) throws IllegalArgumentException {        if (v < 0 || v >= numVertices || w < 0 || w >= numVertices) {            throw new IllegalArgumentException(                "Out of range: v = " + v + ", w = " + w + ".");        }	    if (adjacentVertices[v].contains(w) || adjacentVertices[w].contains(v)) {            adjacentVertices[v].remove(w);            adjacentVertices[w].remove(v);            edgeCosts.remove(new Edge(v,w));            numEdges--;	    }    }