// CSE 143, Winter 2011, Marty Stepp // // This client program creates a tree of integers and prints its elements. // You can see a nice visualization of binary trees in jGRASP's debugger. // // Output: // 29 41 6 17 81 9 40 public class TreeMain { public static void main(String[] args) { IntTreeNode root = new IntTreeNode(17); root.left = new IntTreeNode(41); root.right = new IntTreeNode(9); root.left.left = new IntTreeNode(29); root.left.right = new IntTreeNode(6); root.left.right.right = new IntTreeNode(22); root.right.left = new IntTreeNode(81); root.right.left.left = new IntTreeNode(15); root.right.right = new IntTreeNode(40); IntTree tree = new IntTree(root); tree.print(); IntTree tree2 = new IntTree(null); tree2.print(); } }