Click or drag to resize
RhinoListTBinarySearch Method (Int32, Int32, T, IComparerT)
Searches the entire sorted List for an element using the specified comparer and returns the zero-based index of the element.

Namespace: Rhino.Collections
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.50000.0 (5.0.20693.0)
Syntax
public int BinarySearch(
	int index,
	int count,
	T item,
	IComparer<T> comparer
)

Parameters

index
Type: SystemInt32
The zero-based starting index of the range to search.
count
Type: SystemInt32
The length of the range to search.
item
Type: T
The object to locate. The value can be a null reference (Nothing in Visual Basic) for reference types.
comparer
Type: System.Collections.GenericIComparerT
The IComparer(T) implementation to use when comparing elements. Or a null reference (Nothing in Visual Basic) to use the default comparer Comparer(T)::Default.

Return Value

Type: Int32
The zero-based index of item in the sorted List, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of Count.
See Also