Module org.dyn4j
Package org.dyn4j

Interface BinarySearchTreeSearchCriteria<E extends Comparable<E>>

  • Type Parameters:
    E - the comparable type

    public interface BinarySearchTreeSearchCriteria<E extends Comparable<E>>
    Represents criteria for performing a binary search on a BinarySearchTree.

    The BinarySearchTree.search(BinarySearchTreeSearchCriteria) method performs a binary search and requires some criteria to determine whether to traverse to the left (smaller) or right (larger) child.

    The evaluate(Comparable) method is called for each node visited starting at the root of the tree.

    Since:
    3.2.0
    Version:
    3.2.0
    Author:
    William Bittle
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int evaluate​(E comparable)
      Evaluates the current comparable determining which child to navigate to next.
    • Method Detail

      • evaluate

        int evaluate​(E comparable)
        Evaluates the current comparable determining which child to navigate to next.
        • Return zero to stop the search.
        • Return less than zero to continue searching to the left.
        • Return greater than zero to continue searching to the right
        Parameters:
        comparable - the current comparable
        Returns:
        int