CircularListTSort(ComparisonT) Method

Sorts the elements in the entire CircularListT using the specified ComparisonT.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public void Sort(
	Comparison<T> comparison
)

Parameters

comparison  ComparisonT
The ComparisonT to use when comparing elements.

Remarks

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.

Exceptions

ArgumentNullExceptioncomparison is .
ArgumentExceptionThe implementation of comparison caused an error during the sort.

See Also