Class PairingHeap<T>
A pairing minMax heap implementation.
Inheritance
PairingHeap<T>
Assembly: Advanced.Algorithms.dll
Syntax
public class PairingHeap<T> : IEnumerable<T>, IEnumerable where T : IComparable
Type Parameters
Constructors
PairingHeap(SortDirection)
Declaration
public PairingHeap(SortDirection sortDirection = SortDirection.Ascending)
Parameters
Properties
Count
Declaration
public int Count { get; }
Property Value
Methods
Time complexity: O(log(n)).
Declaration
Returns
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Insert(T)
Insert a new Node.
Time complexity: O(1).
Declaration
public void Insert(T newItem)
Parameters
| Type |
Name |
Description |
| T |
newItem |
|
Merge(PairingHeap<T>)
Merge another heap with this heap.
Time complexity: O(1).
Declaration
public void Merge(PairingHeap<T> PairingHeap)
Parameters
Peek()
Declaration
Returns
UpdateKey(T, T)
Time complexity: O(log(n)).
Declaration
public void UpdateKey(T currentValue, T newValue)
Parameters
| Type |
Name |
Description |
| T |
currentValue |
|
| T |
newValue |
|
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements