MergeSort Class

Class performing a merge sort of an IListT.

It contains methods for both the iterative and recursive algorithm. The recursive is provided for reference only, use the iterative when possible.

As compared to QuickSortT, 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 abstract class MergeSort
Inheritance
Object    MergeSort

Constructors

MergeSortInitializes a new instance of the MergeSort class

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)
SortTT(IListTT) Sort the entire list
SortTT(IListTT, IComparerTT) Sort the entire list
SortTT(IListTT, ComparisonTT) Sort the entire list
SortRecursiveTT(IListTT) Sort the entire list, using recursive algorithm
SortRecursiveTT(IListTT, IComparerTT) Sort the entire list, using recursive algorithm
SortRecursiveTT(IListTT, ComparisonTT) Sort the entire list, using recursive algorithm
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also