Package dsa.iface

Interface IBinaryTree<T>

All Superinterfaces:
ITree<T>
All Known Implementing Classes:
AbstractBinaryTree

public interface IBinaryTree<T> extends ITree<T>
Interface to represent a Binary Tree.
  • Method Details

    • left

      IPosition<T> left(IPosition<T> p)
      Get the left child of position p.
      Parameters:
      p -
      Returns:
    • right

      IPosition<T> right(IPosition<T> p)
      Get the right child of position p.
      Parameters:
      p -
      Returns:
    • hasLeft

      boolean hasLeft(IPosition<T> p)
      Check whether position p has a left child.
      Parameters:
      p -
      Returns:
      true if position p has a left child, false otherwise.
    • hasRight

      boolean hasRight(IPosition<T> p)
      Check whether position p has a right child.
      Parameters:
      p -
      Returns:
      true if position p has a right child, false otherwise.