import BinarySearchTree; import NodeBasedBinaryTree; import BinaryTreePrinter; import SimpleOutput; import StringComparator; /** * Put some strings in a binary search tree and then print it out. * The strings must be specified on the command line. * Takes advantage of knowledge of the internals of the BinarySearchTree * class. * * @author Samuel A. Rebelsky * @version 1.0 of April 1999 */ public class BST_Tester { public static void main(String[] args) { SimpleOutput out = new SimpleOutput(); BinaryTreePrinter printer = new BinaryTreePrinter(); BinarySearchTree bst = new BinarySearchTree( new NodeBasedBinaryTree(), new StringComparator()); for (int i = 0; i < args.length; ++i) { bst.insert(args[i]); out.println("*** After adding " + args[i] + "***"); printer.printTree(out, bst.tree); out.println(); } } // main(String[]) } // class BST_Tester