Java.Util.Arrays.BinarySearch Method
Performs a binary search for value in the ascending sorted array array.

Syntax

[Android.Runtime.Register("binarySearch", "([Ljava/lang/Object;Ljava/lang/Object;)I", "")]
public static int BinarySearch (Java.Lang.Object[] array, Java.Lang.Object object)

Parameters

array
the sorted array to search.
value
the element to find.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.ClassCastExceptionif an element in the array or the search element does not implement Comparable, or cannot be compared to each other.

Remarks

Performs a binary search for value in the ascending sorted array array. 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 1