Java.Util.Arrays.BinarySearch Method
Performs a binary search for value in the ascending sorted array array, in the range specified by fromIndex (inclusive) and toIndex (exclusive).

Syntax

[Android.Runtime.Register("binarySearch", "([IIII)I", "")]
public static int BinarySearch (int[] p0, int p1, int p2, int p3)

Parameters

array
the sorted array to search.
startIndex
the inclusive start index.
endIndex
the exclusive start index.
value
the element to find.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif startIndex > endIndex
Java.Lang.ArrayIndexOutOfBoundsExceptionif startIndex array.length

Remarks

Performs a binary search for value in the ascending sorted array array, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

[Android Documentation]

Requirements

Namespace: Java.Util
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 9