Table of Contents

Class FixedCapacityMinBinaryHeap<T>

Namespace
AlgorithmsSW.PriorityQueue
Assembly
AlgorithmsSW.dll

A container that allows efficient insertions and retrieval of the minimum element.

[AlgorithmReference(2, 6)]
public sealed class FixedCapacityMinBinaryHeap<T> : IPriorityQueue<T>, IEnumerable<T>, IEnumerable

Type Parameters

T
Inheritance
FixedCapacityMinBinaryHeap<T>
Implements
Inherited Members
Extension Methods

Constructors

FixedCapacityMinBinaryHeap(int, IComparer<T>)

public FixedCapacityMinBinaryHeap(int capacity, IComparer<T> comparer)

Parameters

capacity int
comparer IComparer<T>

Properties

Capacity

public int Capacity { get; }

Property Value

int

Count

public int Count { get; }

Property Value

int

IsEmpty

public bool IsEmpty { get; }

Property Value

bool

IsFull

public bool IsFull { get; }

Property Value

bool

IsSingleton

public bool IsSingleton { get; }

Property Value

bool

PeekMin

public T PeekMin { get; }

Property Value

T

Methods

AssertSatisfyHeapProperty()

[Conditional("WITH_INSTRUMENTATION")]
public void AssertSatisfyHeapProperty()

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

An enumerator that can be used to iterate through the collection.

PopMax()

public T PopMax()

Returns

T

PopMin()

Retrieves and removes the minimum element in the heap.

public T PopMin()

Returns

T

Exceptions

InvalidOperationException

the heap is empty.

Push(T)

Pushes a new element onto the heap.

public void Push(T item)

Parameters

item T

Exceptions

InvalidOperationException

the heap is full.

ArgumentNullException

item is null.

ToPrettyString()

public string ToPrettyString()

Returns

string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.