public class BinaryTree<E extends Comparable<E>> {
	protected Node<E> root;
	protected int size = 0;

	//Default constructor
	public BinaryTree() {
	}
	
	//Costruct from an array
	public BinaryTree(E[] objects) {
		for (int i = 0; i < objects.length; i++)
			insert(objects[i]);
	}

	//Search for value
	public boolean search(E e) {
		Node<E> current = root;
		while (current != null) {
			if (e.compareTo(current.element) < 0)
				current = current.left;
			else if (e.compareTo(current.element) > 0)
				current = current.right;
			else
				return true;
		}
		return false;
	}

	//Insert value
	public boolean insert(E e) {
		if (root == null)
			root = new Node<E>(e);
		else {
			Node<E> parent = null;
			Node<E> current = root;
			while (current != null) {
				if (e.compareTo(current.element) < 0) {
					parent = current;
					current = current.left;
				}
				else if (e.compareTo(current.element) > 0) {
					parent = current;
					current = current.right;
				}
				else
					return false;
			}
			if (e.compareTo(parent.element) < 0)
				parent.left = new Node<E>(e);
			else
				parent.right = new Node<E>(e);
		}
		size++;
		return true; // Element inserted
	}

	//Output inorder
	public void inorder() {
		inorder(root);
	}
	protected void inorder(Node<E> root) {
		if (root == null)
			return;
		inorder(root.left);
		System.out.print(root.element + " ");
		inorder(root.right);
	}

	//Output postorder
	public void postorder() {
		postorder(root);
	}
	protected void postorder(Node<E> root) {
		if (root == null)
			return;
		postorder(root.left);
		postorder(root.right);
		System.out.print(root.element + " ");
	}

	//Output preorder
	public void preorder() {
		preorder(root);
	}
	protected void preorder(Node<E> root) {
		if (root == null)
			return;
		System.out.print(root.element + " ");
		preorder(root.left);
		preorder(root.right);
	}

	//The core nucleus thingy kajigger
	public static class Node<E extends Comparable<E>> {
		protected E element;
		protected Node<E> left;
		protected Node<E> right;

		public Node(E e) {
			element = e;
		}
	}

	//Return the size
	public int getSize() {
		return size;
	}

	//Clear array
	public void fire() {
		root = null;
		size = 0;
	}
	
	//Create tree from tree
	public void buildFromFile() {
		
	}
	
	//Print tree to file
	public void printToFile() {
		
	}
	
	//Display tree
	public void displayTree() {
		
	}
}

@@ -1195,20 +1195,22 @@
 %09public 
-void
+String
  inorder
@@ -1216,28 +1216,104 @@
 r() %7B%0A%09%09
-inorder(root
+StringBuilder builder = new StringBuilder();%0A%09%09inorder(root, builder);%0A%09%09return builder(
 );%0A%09%7D%0A%09p
@@ -1338,32 +1338,55 @@
 der(Node%3CE%3E root
+, StringBuilder builder
 ) %7B%0A%09%09if (root =
@@ -1428,32 +1428,30 @@
 eft);%0A%09%09
-System.out.print
+builder.append
 (root.el
@@ -1519,20 +1519,22 @@
 %09public 
-void
+String
  postord
@@ -1542,30 +1542,106 @@
 r() %7B%0A%09%09
-postorder(root
+StringBuilder builder = new StringBuilder();%0A%09%09postorder(root, builder);%0A%09%09return builder(
 );%0A%09%7D%0A%09p
@@ -1668,32 +1668,55 @@
 der(Node%3CE%3E root
+, StringBuilder builder
 ) %7B%0A%09%09if (root =
@@ -1785,32 +1785,30 @@
 ght);%0A%09%09
-System.out.print
+builder.append
 (root.el
@@ -1852,20 +1852,22 @@
 %09public 
-void
+String
  preorde
@@ -1874,29 +1874,96 @@
 r() %7B%0A%09%09
-preorder(root
+StringBuilder builder = new StringBuilder();%0A%09%09preorder(root);%0A%09%09return builder(
 );%0A%09%7D%0A%09p
@@ -1997,16 +1997,39 @@
 %3CE%3E root
+, StringBuilder builder
 ) %7B%0A%09%09if
@@ -2061,24 +2061,22 @@
 ;%0A%09%09
-System.out.print
+builder.append
 (roo

Update BinaryTree.java