RhinoList(T).BinarySearch Method (T, IComparer(T))

RhinoListTBinarySearch Method (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)
Syntax
public int BinarySearch(
	T item,
	IComparer<T> comparer
)
Public Function BinarySearch ( 
	item As T,
	comparer As IComparer(Of T)
) As Integer

Parameters

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.
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.8
See Also