Click or drag to resize
AlgorithmsMaximumT Method (IEnumerableT, IComparerT)
Finds the maximum value in a collection. A supplied IComparer<T> is used to compare the items in the collection.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static T Maximum<T>(
	IEnumerable<T> collection,
	IComparer<T> comparer
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection to search.
comparer
Type: System.Collections.GenericIComparerT
The comparer instance used to compare items in the collection.

Type Parameters

T
The type of items in the collection.

Return Value

Type: T
The largest item in the collection.
Exceptions
ExceptionCondition
InvalidOperationExceptionThe collection is empty.
ArgumentNullExceptioncollection or comparer is null.
See Also