Click or drag to resize

GenericExtensionsSortT Method (IListT, IComparerT)

Sorts the elements in the entire List{T} using the provided comparer.

A quick sort algorithm is used. Quick sort is a un-stable sort algorithm i.e. if two elements are equal their order may not be preserved.

If the provided IList is either an array or a list, the build in sorting method is used (also quick sort).

Namespace:  DHI.Mike1D.Generic
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public static void Sort<T>(
	this IList<T> list,
	IComparer<T> comparer
)

Parameters

list
Type: System.Collections.GenericIListT
List to sort
comparer
Type: System.Collections.GenericIComparerT
Comparer to use while sorting

Type Parameters

T
Type of elements to sort

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IListT. 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