// Program to test the IntSearchTree class by constructing // a binary search tree and printing its structure and // contents. import java.util.*; public class IntSearchTreeClient { public static void main(String[] args) { IntSearchTree tree = new IntSearchTree(); Scanner console = new Scanner(System.in); System.out.print("Next int? (0 to stop) "); int number = console.nextInt(); while (number != 0) { tree.add(number); System.out.print("Next int? (0 to stop) "); number = console.nextInt(); } System.out.println(); System.out.println("Tree structure:"); tree.printSideways(); System.out.println(); tree.printInorder(); } }