// CSE 143, summer 2012 // An IntTree object represents an entire binary tree of ints. public class IntTree { private IntTreeNode overallRoot; // Constructs an empty binary tree public IntTree() { overallRoot = null; } // Constructs a binary tree with the given node as its root. public IntTree(IntTreeNode overallRoot) { this.overallRoot = overallRoot; } // Prints all elements of this tree in left to right order. public void print() { print(overallRoot); } // Prints a portion of the overall tree private void print (IntTreeNode root) { if (root != null) { // print left print(root.left); // prints data System.out.print (root.data + " "); // print right print(root.right); } } }