Subversion Repositories programming

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
28 irasnyd 1
// Written by Ira Snyder
2
// Due Date: 11-15-2004
3
// Project #3
4
import java.io.*;
5
 
6
class Driver {
29 irasnyd 7
    public static void main ( String [] args ) throws Exception {
8
 
9
        System.out.println( test_12_2() );
10
 
11
    } //end main
28 irasnyd 12
 
29 irasnyd 13
    public static boolean test_12_2() {
14
        BinaryTree treeB = new BinaryTree("B");
15
        BinaryTree treeD = new BinaryTree("D");
16
        BinaryTree treeE = new BinaryTree("E");
17
        BinaryTree treeC = new BinaryTree("C",treeD,treeE);
18
        BinaryTree treeA = new BinaryTree("A",treeB,treeC);
19
 
20
        String experimentalResult = treeA.toString();
21
 
22
        String correctResult = "((B),A,((D),C,(E)))";
23
 
24
        return correctResult.equals(experimentalResult);
25
    }
26
 
27
 
28 irasnyd 28
} //end class Driver
29
 
30
/*
31
      BufferedReader kb = new BufferedReader(
32
                              new InputStreamReader(System.in));
33
 
34
 
35
      BufferedReader br = new BufferedReader(
36
                              new InputStreamReader(
37
                                  new FileInputStream(filename)));
38
 
39
      PrintStream ps = new PrintStream(
40
                           new FileOutputStream(
41
                               new File(filename)));
42
 
43
*/
44