Home > @rushstack/node-core-library > MinimumHeap
MinimumHeap class
Implements a standard heap data structure for items of type T and a custom comparator. The root will always be the minimum value as determined by the comparator.
Signature:
export declare class MinimumHeap<T>
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new MinimumHeap instance. |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| number | Returns the number of items in the heap. |
Methods
Method | Modifiers | Description |
|---|---|---|
Retrieves the root item from the heap without removing it. | ||
Retrieves and removes the root item from the heap. The next smallest item will become the new root. | ||
Pushes an item into the heap. |