CS 596Fall Semester, 1998Assignment 2 Test Data To Assignment IndexSan Diego State University -- This page last updated 1-Oct 98

Create three empty trees, testOne, testTwo, and testThree. Perform the
following tests.

Test One

System.out.println( "Empty Test One " + testOne );
testOne.put( 6, "a");
testOne.put( 5, "b");
testOne.put( 4, "c");
testOne.put( 3, "d");
testOne.put( 2, "e");
testOne.put( 1, "f");
System.out.println( "Full Test One " + testOne );

Test Two

System.out.println( "Empty Test Two " + testTwo );
testTwo.put( 2, "a");
testTwo.put( 1, "b");
testTwo.put( 4, "c");
testTwo.put( 3, "d");
testTwo.put( 6, "e");
testTwo.put( 5, "f");
System.out.println( "Full Test Two " + testTwo );

Test Three

System.out.println( "Empty Test Three " + testThree );
testThree.put( 4, "a");
testThree.put( 9, "b");
testThree.put( 3, "c");
testThree.put( 8, "d");
testThree.put( 10, "e");
testThree.put( 5, "f");
testThree.put( 6, "g");
testThree.put( 1, "h");
testThree.put( 2, "i");

System.out.println( "Full Test Three " + testThree );
System.out.println( "Contains 3 " + testThree.contains( 3 ) );
System.out.println( "Contains 7 " + testThree.contains( 7 ) );

Object value = testThree.get( 2 );
System.out.println( "Get 2 result " + value );
testThree.put( 2, new Integer( 42 ));
System.out.println( "Get 2 result " + testThree.get( 2 ));

Copyright © 1998 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.