Wintellect.PowerCollections Namespace
Algorithms Class
Algorithms Methods
GhostDoc Pro Sample Help File

Algorithms..::..Minimum<(Of <(<'T>)>)> Method (IEnumerable<(Of <(<'T>)>)>, IComparer<(Of <(<'T>)>)>)

Finds the minimum value in a collection. A supplied IComparer<T> is used to compare the items in the collection.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public static T Minimum<T>(
	IEnumerable<T> collection,
	IComparer<T> comparer
)
where T : IComparable<T>
Public Shared Function Minimum(Of T As IComparable(Of T)) ( _
	collection As IEnumerable(Of T), _
	comparer As IComparer(Of T) _
) As T
public:
generic<typename T>
where T : IComparable<T>
static T Minimum(
	IEnumerable<T>^ collection, 
	IComparer<T>^ comparer
)

Type Parameters

T
The type of items in the collection.

Parameters

collection
Type: IEnumerable<(Of <(<'T>)>)>
The collection to search.
comparer
Type: IComparer<(Of <(<'T>)>)>
The comparer instance used to compare items in the collection.

Return Value

The smallest item in the collection.

Exceptions


ExceptionCondition
InvalidOperationExceptionThe collection is empty.
ArgumentNullExceptioncollection or comparer is null.