BinarySearchIndexOf Method |
Returns the index of the specified key in the specified array.
Namespace: Algs4NetAssembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static int IndexOf(
int[] a,
int key
)
Parameters
- a
- Type: SystemInt32
a the array of integers, must be sorted in ascending order - key
- Type: SystemInt32
key the search key
Return Value
Type:
Int32index of key in array
a if present;
-1 otherwise
See Also