/* ITI 1121/1521. Introduction to Computer Science II * Assignment/Devoir 3 * * */ public class A5Q8 { public static void main( String[] args ) { StudentInfo.display(); BinarySearchTree t; t = new BinarySearchTree(); String[] xs = { "F", "B", "H", "G", "A", "D", "C", "E" }; System.out.println( t ); System.out.println( t.toListInOrder() ); for ( int i=0; i < xs.length; i++ ) { t.add( xs[ i ] ); System.out.println(); System.out.println( t ); System.out.println( t.toListInOrder() ); } System.out.println(); } } // > java A5Q8 // // ************************************************************ // * * // * * // * * // * * // ************************************************************ // // () // [] // // (()F()) // [F] // // ((()B())F()) // [B,F] // // ((()B())F(()H())) // [B,F,H] // // ((()B())F((()G())H())) // [B,F,G,H] // // (((()A())B())F((()G())H())) // [A,B,F,G,H] // // (((()A())B(()D()))F((()G())H())) // [A,B,D,F,G,H] // // (((()A())B((()C())D()))F((()G())H())) // [A,B,C,D,F,G,H] // // (((()A())B((()C())D(()E())))F((()G())H())) // [A,B,C,D,E,F,G,H]