TestSimpleDirectedGraph - /* *...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * @(#)TestSimpleDirectedGraph.java * * * @author Alexandros Zerzelidis * @version 2.00 2009/5/20 */ public class TestSimpleDirectedGraph { p public TestSimpleDirectedGraph() { } public static void main(String[] args) { SimpleDirectedGraph sdg = new SimpleDirectedGraph(); S String v1 = new String("sV1"); String v2 = new String("sV2"); String v3 = new String("sV3"); String v4 = new String("sV4"); String v5 = new String("sV5"); String v6 = new String("sV6"); String v7 = new String("sV7"); String v8 = new String("sV8"); S sdg.addVertex(v1); sdg.addVertex(v2); sdg.addVertex(v3); sdg.addVertex(v4); sdg.addVertex(v5); sdg.addVertex(v6); sdg.addVertex(v7); sdg.addVertex(v8); System.out.println(sdg.toString()); S //test loop 1 for (int i=0;i<10;i++) { sdg.deleteVertex(v6); System.out.print(sdg.order()+" "); sdg.deleteVertex(v2); System.out.print(sdg.order()+" "); sdg.deleteVertex(v5); System.out.print(sdg.order()+" "); S sdg.addVertex(v6); System.out.print(sdg.order()+" "); sdg.addVertex(v2);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/26/2010 for the course COMPUTER S Java2 taught by Professor Kwstasmixail during the Spring '10 term at Technical University of Crete.

Page1 / 2

TestSimpleDirectedGraph - /* *...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online