Class BHeap<T>
A binary heap implementation.
Assembly: Advanced.Algorithms.dll
Syntax
public class BHeap<T> : IEnumerable<T>, IEnumerable where T : IComparable
Type Parameters
Constructors
|
Improve this Doc
View Source
BHeap(SortDirection)
Declaration
public BHeap(SortDirection sortDirection = SortDirection.Ascending)
Parameters
|
Improve this Doc
View Source
BHeap(SortDirection, IComparer<T>)
Declaration
public BHeap(SortDirection sortDirection, IComparer<T> comparer)
Parameters
|
Improve this Doc
View Source
BHeap(SortDirection, IEnumerable<T>)
Declaration
public BHeap(SortDirection sortDirection, IEnumerable<T> initial)
Parameters
|
Improve this Doc
View Source
BHeap(SortDirection, IEnumerable<T>, IComparer<T>)
Time complexity: O(n) if initial is provided. Otherwise O(1).
Declaration
public BHeap(SortDirection sortDirection, IEnumerable<T> initial, IComparer<T> comparer)
Parameters
Properties
|
Improve this Doc
View Source
Count
Declaration
public int Count { get; }
Property Value
Methods
|
Improve this Doc
View Source
Delete(T)
Declaration
public void Delete(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
|
Improve this Doc
View Source
Exists(T)
Declaration
public bool Exists(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
|
Improve this Doc
View Source
Time complexity: O(log(n)).
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)).
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