QuickSortT Class

Class performing quicksort of an IListT

As compared to MergeSortT, merge sort is stable (preserves order of equal elements), but uses more memory (an extra array of the same size). Quick sort is un-stable, but performs in-place sorting.

Definition

Namespace: DHI.Mike1D.Generic
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class QuickSort<T>
Inheritance
Object    QuickSortT

Type Parameters

T
Type of elements in the list

Constructors

QuickSortT(IListT) Creates an instance for sorting
QuickSortT(IListT, IComparerT) Creates an instance for sorting

Properties

CompareCount Number of compares during the sorting procedure
SwapCount Number of swaps during the sorting procedure

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Sort Sort entire list
Sort(Int32, Int32) Sort list within the provided indices (inclusive)
SortWpVersion Sort entire list.

Version from Wikipedia, which is not optimal

SortWpVersion(Int32, Int32) Sort list within the provided indices (inclusive)

Version from Wikipedia, which is not optimal

ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also