BigList<(Of <(<'T>)>)>..::..BinarySearch Method (T)
Searches a sorted list for an item via binary search. The list must be sorted
in the order defined by the default ordering of the item type; otherwise,
incorrect results will be returned.
Namespace:
Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
Parameters
- item
- Type: T
The item to search for.
Return Value
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.Exceptions
Exception | Condition |
---|---|
InvalidOperationException | The type T does not implement either the IComparable or IComparable<T> interfaces. |