Subversion Repositories programming

Rev

Rev 28 | Blame | Last modification | View Log | RSS feed

// Written by Ira Snyder
// Due Date: 11-15-2004
// Project #3
import java.io.*;

class Driver {
    public static void main ( String [] args ) throws Exception {
    
        System.out.println( test_12_2() );
    
    } //end main

    public static boolean test_12_2() {
        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);
        
        String experimentalResult = treeA.toString();

        String correctResult = "((B),A,((D),C,(E)))";

        return correctResult.equals(experimentalResult);
    }


} //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)));

*/