public class BTNode{ //Instance variables: private E element; private BTNode left; private BTNode right; /**Creates a node with null references to its element and next node */ public BTNode(){ this(null,null,null); } /** Creates a node with the given element and next node */ public BTNode(E e, BTNode l,BTNode r){ element = e; left=l; right=r; } /**copy constructor*/ public BTNode(BTNode p){ element=p.getElement(); left=p.getLeft(); right=p.getRight(); } public E getElement() { return element; } public void setElement(E element) { this.element = element; } public BTNode getLeft() { return left; } public void setLeft(BTNode left) { this.left = left; } public BTNode getRight() { return right; } public void setRight(BTNode right) { this.right = right; } }