Rev 29 | Rev 31 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
// Written by Ira Snyder// Due Date: 11-15-2004// Project #3import java.io.*;class Driver {public static void main ( String [] args ) throws Exception {System.out.println( test_12_2() );} //end mainpublic static BinaryTree createTestTree() {BinaryTree treeB = new BinaryTree("B");BinaryTree treeD = new BinaryTree("D");BinaryTree treeE = new BinaryTree("E");BinaryTree treeC = new BinaryTree("C",treeD,treeE);BinaryTree treeA = new BinaryTree("A",treeB,treeC);return treeA;}public static String test_12_2() {BinaryTree treeA = createTestTree();String experimentalResult = treeA.toString();String correctResult = "((B),A,((D),C,(E)))";if( correctResult.equals(experimentalResult) )return "test_12_2: PASSED";return "test_12_2: *** FAILED ***";}} //end class Driver/*BufferedReader kb = new BufferedReader(new InputStreamReader(System.in));BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));PrintStream ps = new PrintStream(new FileOutputStream(new File(filename)));*/