Class HeapSort<T>
A heap sort implementation.
Inherited Members
Namespace: Advanced.Algorithms.Sorting
Assembly: Advanced.Algorithms.dll
Syntax
public class HeapSort<T>
where T : IComparable
Type Parameters
| Name | Description |
|---|---|
| T |
Methods
Sort(ICollection<T>, SortDirection)
Time complexity: O(nlog(n)).
Declaration
public static T[] Sort(ICollection<T> collection, SortDirection sortDirection = SortDirection.Ascending)
Parameters
| Type | Name | Description |
|---|---|---|
| ICollection<T> | collection | |
| SortDirection | sortDirection |
Returns
| Type | Description |
|---|---|
| T[] |