Class DaryHeap<T>
A D-ary minMax heap implementation.
Assembly: Advanced.Algorithms.dll
Syntax
public class DaryHeap<T> : IEnumerable<T>, IEnumerable where T : IComparable
Type Parameters
Constructors
|
Improve this Doc
View Source
DaryHeap(Int32, SortDirection, IEnumerable<T>)
Time complexity: O(n) when initial is provided otherwise O(1).
Declaration
public DaryHeap(int k, SortDirection sortDirection = SortDirection.Ascending, IEnumerable<T> initial = null)
Parameters
Fields
|
Improve this Doc
View Source
Count
Declaration
Field Value
Methods
|
Improve this Doc
View Source
Time complexity: O(log(n) base K).
Declaration
Returns
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
|
Improve this Doc
View Source
Insert(T)
Time complexity: O(log(n) base K).
Declaration
public void Insert(T newItem)
Parameters
Type |
Name |
Description |
T |
newItem |
|
|
Improve this Doc
View Source
Peek()
Declaration
Returns
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements