Class FloatBinarySearch

java.lang.Object
org.magicwerk.brownies.collections.helper.primitive.FloatBinarySearch

public class FloatBinarySearch extends Object
Binary search for primitive type float.
  • Constructor Details

    • FloatBinarySearch

      public FloatBinarySearch()
  • Method Details

    • binarySearch

      public static int binarySearch(IFloatList list, float key, int lower, int upper)
      Searches the specified list for the specified object using the binary search algorithm. The list must be sorted into ascending order according to the specified comparator (as by the Collections.sort(List, Comparator) method), prior to making this call. If it is not sorted, the results are undefined.

      This method runs in log(n) time on random-access lists, which offer near-constant-time access to each list element.

      Parameters:
      list - the list to be searched.
      key - the value to be searched for.
      lower - lower bound of range to search
      upper - upper bound of range to search
      Returns:
      the index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1).