package edu.oakland.OUSoft.BST;

public class cseBST<E extends Comparable<E>> {
	
	private Node<E> root;
	
	public boolean contains(E o) {
		return containsRecurse(root, o);
	}
	
	private boolean containsRecurse(Node<E> node, E e) {
		if (node == null || e == null) {
			return false;
		}
		if (node.element.equals(e)) {
			return true;
		} else {
			if (e.compareTo(node.element) <= 0) {
				return containsRecurse(node.left, e);
			} else {
				return containsRecurse(node.right, e);
			}
		}
	}
	
	public boolean add(E e) {
		root = addRecurse(root, e);
		return true;
	}
	
	private Node<E> addRecurse(Node<E> node, E e) {
		if (node == null) {
			return new Node<>(e);
		} else if (e.compareTo(node.element) <= 0) {
			node.left = addRecurse(node.left, e);
		} else {
			node.right = addRecurse(node.right, e);
		}
		return node;
	}
	
	public boolean remove(E e) {
		throw new UnsupportedOperationException("Not implemented yet.");
	}
	
	public int size() {
		throw new UnsupportedOperationException("Not implemented yet.");
	}
	
	public boolean isEmpty() {
		throw new UnsupportedOperationException("Not implemented yet.");
	}
	
	public void clear() {
		root = new Node<>(null);
	}
	
	private class Node<E> {
		E element;
		Node<E> left;
		Node<E> right;
		
		public Node(E e) {
			this.element = e;
		}
	}
	
}

@@ -26,16 +26,44 @@
 t.BST;%0A%0A
+import java.util.Iterator;%0A%0A
 public c
@@ -98,16 +98,39 @@
 able%3CE%3E%3E
+ implements Iterable%3CE%3E
  %7B%0A%09%0A%09pr
@@ -1225,32 +1225,367 @@
 e%3C%3E(null);%0A%09%7D%0A%09%0A
+%09/**%0A%09 * Returns an iterator over elements using Inorder method%0A%09 *%0A%09 * @return an Iterator.%0A%09 */%0A%09@Override%0A%09public Iterator%3CE%3E iterator() %7B%0A%09%09return new Iterator%3CE%3E() %7B%0A%09%09%09Node%3CE%3E node = root;%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09public boolean hasNext() %7B%0A%09%09%09%09return false;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09public E next() %7B%0A%09%09%09%09return null;%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%09%0A
 %09private class N

Add the unimplemented iterator code