Method BinarySearch
BinarySearch(int, int, T, IComparer<T>?)
Searches a range of items in the sorted list and returns the index of the item.
Declaration
public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)Parameters
| Type | Name | Description | 
|---|---|---|
| int | index | |
| int | count | |
| T | item | |
| IComparer<T> | comparer | 
Returns
| Type | Description | 
|---|---|
| int | The index of  | 
BinarySearch(T)
Searches the items in the sorted list and returns the index of the item.
Declaration
public int BinarySearch(T item)Parameters
| Type | Name | Description | 
|---|---|---|
| T | item | 
Returns
| Type | Description | 
|---|---|
| int | The index of  | 
BinarySearch(T, IComparer<T>?)
Searches the items in the sorted list and returns the index of the item.
Declaration
public int BinarySearch(T item, IComparer<T>? comparer)Parameters
| Type | Name | Description | 
|---|---|---|
| T | item | |
| IComparer<T> | comparer | 
Returns
| Type | Description | 
|---|---|
| int | The index of  | 
