Click or drag to resize
AlgorithmsBinarySearchT Method (IListT, T, Int32)
Searches a sorted list for an item via binary search. The list must be sorted by the natural ordering of the type (it's implementation of IComparable<T>).

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static int BinarySearch<T>(
	IList<T> list,
	T item,
	out int index
)
where T : Object, IComparable<T>

Parameters

list
Type: System.Collections.GenericIListT
The sorted list to search.
item
Type: T
The item to search for.
index
Type: SystemInt32
Returns the first index at which the item can be found. If the return value is zero, indicating that item was not present in the list, then this returns the index at which item could be inserted to maintain the sorted order of the list.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.BinarySearch``1(System.Collections.Generic.IList{``0},``0,System.Int32@)"]

Return Value

Type: Int32
The number of items equal to item that appear in the list.
See Also