// Helene Martin, CSE 143 // Creates a binary search tree of integers. public class IntSearchTreeClient { public static void main(String[] args) { // build a tree out of nodes (use the jGRASP debugger to see its // structure) IntTreeNode root = new IntTreeNode(55); root.left = new IntTreeNode(29); root.left.left = new IntTreeNode(-3); root.left.right = new IntTreeNode(42); root.right = new IntTreeNode(87); root.right.right = new IntTreeNode(91); root.right.left = new IntTreeNode(60); // set the tree's overall root as the root of the tree we just built IntSearchTree tree = new IntSearchTree(root); // use the jGRASP debugger to see the different traversal orders tree.printPreOrder(); tree.printInOrder(); tree.printPostOrder(); // test the contains method System.out.println(tree.contains(29)); // true System.out.println(tree.contains(55)); // true System.out.println(tree.contains(63)); // false System.out.println(tree.contains(35)); // false IntSearchTree tree2 = new IntSearchTree(); tree2.add(42); tree2.add(5); tree2.printInOrder(); } }