Click or drag to resize
AlgorithmsIndexOfMaximumT Method (IListT)
Finds the index of the maximum value in a list.

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

Parameters

list
Type: System.Collections.GenericIListT
The list to search.

Type Parameters

T
The type of items in the list.

Return Value

Type: Int32
The index of the largest item in the list. If the maximum value appears multiple times, the index of the first appearance is used. If the list is empty, -1 is returned.
Exceptions
ExceptionCondition
ArgumentNullExceptionlist is null.
Remarks
Values in the list are compared by using the IComparable<T> interfaces implementation on the type T.
See Also