package browser;

import java.util.Iterator;

public class BinaryTree<E> {

	private E data;
	private BinaryTree<E> right = null;
	private BinaryTree<E> left = null;
	private BinaryTree<E> father = null;

	public BinaryTree(E data, BinaryTree<E> left, BinaryTree<E> right) {
		if (left != null && left.father != null || right != null
				&& right.father != null)
			throw new IllegalArgumentException();
		this.data = data;
		this.left = left;
		this.right = right;
		left.father = right.father = this;
	}
	
	public Iterator<E> prefixeDFS() {
		return new Iterator<E>() {
			BinaryTree<E> next = BinaryTree.this;
			BinaryTree<E> previous = null;

			public boolean hasNext() {
				return next != null;
			}

			@Override
			public E next() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public void remove() {
				// TODO Auto-generated method stub
				
			}
			
		};
	}
}
