public void Sort(
int index,
int count,
IComparer<T>? comparer
)
Public Sub Sort (
index As Integer,
count As Integer,
comparer As IComparer(Of T)
)
public:
void Sort(
int index,
int count,
IComparer<T>^ comparer
)
member Sort :
index : int *
count : int *
comparer : IComparer<'T> -> unit
If comparer is , then if T is an enum, this method uses the EnumComparer<TEnum>.Comparer; otherwise, the default comparer Comparer<T>.Default checks whether type T implements the IComparableT generic interface and uses that implementation, if available. If not, Comparer<T>.Default checks whether type T implements the IComparable interface. If type T does not implement either interface, Comparer<T>.Default throws an InvalidOperationException.
This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.
On average, this method is an O(n log n) operation, where n is Count; in the worst case it is an O(n ^ 2) operation.
ArgumentOutOfRangeException | index is less than 0.
-or- count is less than 0. |
ArgumentException | index and count do not specify a valid range in the CircularListT.
-or- countThe implementation of comparer caused an error during the sort. |
InvalidOperationException | comparer is , and the default comparer Default cannot find implementation of the IComparableT generic interface or the IComparable interface for type T. |