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

Algorithms..::..StableSortInPlace<(Of <(<'T>)>)> Method (IList<(Of <(<'T>)>)>, IComparer<(Of <(<'T>)>)>)

Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used to compare the items in the list.

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

Syntax


public static void StableSortInPlace<T>(
	IList<T> list,
	IComparer<T> comparer
)
where T : IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>
Public Shared Sub StableSortInPlace(Of T As {IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T)}) ( _
	list As IList(Of T), _
	comparer As IComparer(Of T) _
)
public:
generic<typename T>
where T : IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>
static void StableSortInPlace(
	IList<T>^ list, 
	IComparer<T>^ comparer
)

Type Parameters

T

Parameters

list
Type: IList<(Of <(<'T>)>)>
The list or array to sort.
comparer
Type: IComparer<(Of <(<'T>)>)>
The comparer instance used to compare items in the collection. Only the Compare method is used.

Remarks


Although arrays cast to IList<T> are normally read-only, this method will work correctly and modify an array passed as list.