public interface BST> { /** * @return the root node of the tree , * null if it is empty */ BinaryNode getRoot (); /** * Update the root to n. * @param n the new root */ void setRoot ( BinaryNode n); /** Traversal type */ static enum Traversal { /** Visits current node first, sons after. */ PREORDER, /** Visits left son first , * current node after and right son last. * This visit is defined only for binary tree. */ INORDER, /** Visits sons first, current node after */ POSTORDER, /** * Visit the tree based on level */ BREADTH, } /** Makes a visit operation on node n. * @param n node to visit */ void visit (BinaryNode n); /** Makes a type traversal of this tree. * For each node, calls #visit(Node). * * @param type a kind of traversal. */ void traversal (Traversal type); /** Puts item into the tree in a position that * preserves the natural order . . . . */ void put( T item ); /** Gets item. * @param item * @return the node that contains item if it is * present, null otherwise */ BinaryNode get(T item ); /** Remove item */ void remove (T item ); }