Click or drag to resize
BigListTBinarySearch Method (T, IComparerT)
Searches a sorted list for an item via binary search. The list must be sorted by the ordering defined by the passed IComparer<T> interface; otherwise, incorrect results will be returned.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public int BinarySearch(
	T item,
	IComparer<T> comparer
)

Parameters

item
Type: T
The item to search for.
comparer
Type: System.Collections.GenericIComparerT
The IComparer<T> interface used to sort the list.

Return Value

Type: Int32
Returns the index of the first occurence of item in the list. If the item does not occur in the list, the bitwise complement of the first item larger than item in the list is returned. If no item is larger than item, the bitwise complement of Count is returned.
See Also