Click or drag to resize
BinarySearchRank Method
Returns the index of the specified key in the specified array. This function is poorly named because it does not give the Rank if the array has duplicate keys or if the key is not in the array.

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static int Rank(
	int key,
	int[] a
)

Parameters

key
Type: SystemInt32
key the search key
a
Type: SystemInt32
a the array of integers, must be sorted in ascending order

Return Value

Type: Int32
index of key in array a if present; -1 otherwise
Remarks
See Also