From charlesreid1

Can I just get a simple dang tree class goin up in here plz?

KTNX

Here's a functional tree node:

	/** Expression Tree Node.
	 *
	 * Could make this an <E>, 
	 * or distinguish internal/external,
	 * operator and number nodes,
	 * but will make these all expressions.
	 *
	 * Could make this process Strings, 
	 * but will assume everything is single-digit,
	 * single chars only.
	 */
	class TreeNode {
		Character element;
		TreeNode left, right;
		public TreeNode(Character e) { 
			this.element = e;
		}
		public int nChildren() { 
			int nc = 0;
			if(left!=null) nc++;
			if(right!=null) nc++;
			return nc;
		}
		public String toString() { /* ? */ }
		public Character getElement() { return this.element; }
		public void setElement(Character v) { this.element = v; }
		public void setLeft(TreeNode newl) { this.left = newl; }
		public void setRight(TreeNode newr) { this.right = newr; }
	}


Put this inside a Tree class:

public class  Tree {
	TreeNode root;

	public ExpressionTree() {
		root = null;
	}

}

Git you a nice tree there.