Click or drag to resize

RankedDictionaryTKey, TValueIndexOfKey Method

Gets the index of the element with the supplied key.

Namespace:  Kaos.Collections
Assembly:  KaosCollections (in KaosCollections.dll) Version: 4.2.0.0
Syntax
C#
public int IndexOfKey(
	TKey key
)

Parameters

key
Type: TKey
The key of the element to find.

Return Value

Type: Int32
The index of the element containing key if found; otherwise a negative value holding the bitwise complement of the insert point.
Exceptions
ExceptionCondition
ArgumentNullExceptionWhen key is null.
Remarks

If key is not found, apply the bitwise complement operator (~) to the result to get the index of the next higher element.

This is a O(log n) operation.

See Also