/**
 * The K_BinaryTree interface specifies the methods for a binary tree.
 * 
 * @author Alyce Brady
 * @version 16 November 2025
 * 
 * Student Modifications:
 *     Modifier: studentName
 *     Modification Date: currentDate
 *     Modifications Made:  Implemented ...
 * 
 */

public interface K_BinaryTree<T>
{
    /** Tests whether this is an empty tree.
     *      @return True if the tree is empty; false otherwise.
     */
    boolean isEmpty();

    /** Adds data to a binary tree.
     *    @param value The value to be added to the tree.
     */
    void add(T value);

    /** Removes a node from the tree, returning the data that was at that
     *  node.  If the item is not found, this method returns null.
     *    @param itemToFind  The data value to find and remove from the tree.
     *    @return The removed item, or null if the item was not found.
     */
    T remove(T itemToFind);

    /** Traverses the tree using a pre-order depth-first traversal, calling
     *  the visitor to act on each node in the tree.
     *    @param visitor    Object that visits and acts on each node in tree.
     */
    void preOrderTraversal(NodeVisitor<T> visitor);

    /** Traverses the tree using an in-order depth-first traversal, calling
     *  the visitor to act on each node in the tree.
     *    @param visitor    Object that visits and acts on each node in tree.
     */
    void inOrderTraversal(NodeVisitor<T> visitor);

    /** Traverses the tree using a post-order depth-first traversal, calling
     *  the visitor to act on each node in the tree.
     *    @param visitor    Object that visits and acts on each node in tree.
     */
    void postOrderTraversal(NodeVisitor<T> visitor);

    /** Traverses the tree using a breadth-first traversal, calling
     *  the visitor to act on each node in the tree.
     *    @param visitor    Object that visits and acts on each node in tree.
     */
    void breadthFirstTraversal(NodeVisitor<T> visitor);

    /** Returns the height of the tree, defined as the number of nodes on
     *  the longest path from the root to a leaf.
     *    @return The height of the binary tree.
     */
    int height();

}    //end interface K_BinaryTree<T>
