Interface BinarySearch.LongSearchTarget

Enclosing class:
BinarySearch
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface BinarySearch.LongSearchTarget
Represents the search target that can be found through bisecting the long integer domain.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    locate(long low, long mid, long high)
    Given a range of [low..high] inclusively with mid as the middle point of the binary search, locates the target.
  • Method Details

    • locate

      int locate(long low, long mid, long high)
      Given a range of [low..high] inclusively with mid as the middle point of the binary search, locates the target.

      Returns 0 if mid is the target; negative to find it in the lower range of [low..mid); or positive to find it in the upper range of (mid..high].

      It's guaranteed that low <= mid <= high.