All pastes #410847 Raw Edit

Anonymous

public java v1 · immutable
#410847 ·published 2007-03-26 18:31 UTC
rendered paste body
import java.util.*;public class Test {	public static void main(String args[]) {		testListGraph();		specialTest(100);	}		public static void testListGraph() {		ListGraphTest p = new ListGraphTest();		p.setUp();		p.testAreAdjacent();		p.tearDown();				p.setUp();		p.testToString();		p.tearDown();				p.setUp();		p.testNumVertices();		p.tearDown();				p.setUp();		p.testNumEdges();		p.tearDown();				p.setUp();		p.testDegree();		p.tearDown();				p.setUp();		p.testAdjacentVertices();		p.tearDown();				p.setUp();		p.testEdges();		p.tearDown();	}		public static void specialTest(int n) {		if(n>0) {			Random randomizer = new Random();			ListGraph test = new ListGraph(n);			for(int i=0; i<n; i++) {				test.addEdge(randomizer.nextInt(n), randomizer.nextInt(n));			}			GraphAlgorithms b = new GraphAlgorithms();			b.printComponentsDFS(test);		}	}}