/* Tree.java */ package tree; /** * An interface for general trees (i.e., where a node can have any number of * children). * @author Jonathan Shewchuk */ public interface Tree { public boolean isEmpty(); /** * isEmpty() returns true if the Tree has no nodes; false otherwise. */ public int size(); /** * size() returns the number of nodes in the Tree. */ public TreePosition root(); /** * root() constructs a TreePosition that refers to the root node. Returns * an invalid position if the tree is empty. */ public void insertRoot(Object value); /** * insertRoot() inserts a node containing "value" at the root of the tree. * If a root already exists, it becomes a child of the node containing * "value". */ }