Whetstone Class reference
Whetstone Class reference
Whetstone
WhetStone Namespaces
WhetStone.Looping
binarySearch Class
binarySearch Methods
BinarySearch Method
BinarySearch(T) Method (IList(T), Func(T, Int32))
BinarySearch(T) Method (IList(T), Func(T, Boolean), binarySearch.BooleanBinSearchStyle)
BinarySearch(T) Method (IList(T), T, IComparer(T))
BinarySearch Method (Func(Int32, Int32), Nullable(Int32), Nullable(Int32), Int32)
BinarySearch Method (Func(Int32, Boolean), Nullable(Int32), Nullable(Int32), Int32, binarySearch.BooleanBinSearchStyle)
BinarySearch(T, V) Method (Func(T, V), T, T, V, T)
binarySearch
BinarySearch
T
Method (IList
T
,
T
, IComparer
T
)
Performs a binary search for an element in an
IList
T
.
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
Copy
public
static
int
BinarySearch
<T>(
this
IList
<T>
this
, T
tofind
,
IComparer
<T>
comp
=
null
)
Parameters
this
Type:
System.Collections.Generic
IList
T
The sorted
IList
T
to perform the search on.
tofind
Type:
T
The element to search for.
comp
(Optional)
Type:
System.Collections.Generic
IComparer
T
The comparer by which
this
is sorted. If set to null, the default comparer will be used.
Type Parameters
T
The type of the
IList
T
.
Return Value
Type:
Int32
The index of
tofind
in
this
, or -1 if
tofind
is not in
this
.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IList
T
. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic)
or
Extension Methods (C# Programming Guide)
.
See Also
Reference
binarySearch Class
BinarySearch Overload
WhetStone.Looping Namespace