public final class BinarySearch extends Object
Constructor and Description |
---|
BinarySearch() |
Modifier and Type | Method and Description |
---|---|
static int |
find(double[] arr,
int low,
int high,
double v)
Binary Search for the index of the exact double value in the given search range.
|
static int |
find(float[] arr,
int low,
int high,
float v)
Binary Search for the index of the exact float value in the given search range.
|
static int |
find(long[] arr,
int low,
int high,
long v)
Binary Search for the index of the exact long value in the given search range.
|
public static int find(float[] arr, int low, int high, float v)
arr
- The given ordered array to search.low
- the index of the lowest value of the search rangehigh
- the index of the highest value of the search rangev
- the value to search forpublic static int find(double[] arr, int low, int high, double v)
arr
- The given ordered array to search.low
- the index of the lowest value of the search rangehigh
- the index of the highest value of the search rangev
- the value to search forpublic static int find(long[] arr, int low, int high, long v)
arr
- The given ordered array to search.low
- the index of the lowest value of the search rangehigh
- the index of the highest value of the search rangev
- the value to search forCopyright © 2015–2021 The Apache Software Foundation. All rights reserved.