Heap Class
Signature
export declare class Heap<T>
Type Parameters
Parameter | Description |
---|---|
T |
Constructors
Constructor | Description |
---|---|
(constructor)(a, comp) | Constructs a new instance of the Heap class |
Properties
Property | Type | Description |
---|---|---|
comp | Comparer<T> |
Methods
Method | Return Type | Description |
---|---|---|
add(x) | void | |
count() | number | |
get() | T | |
peek() | T |
Constructor Details
(constructor)
Constructs a new instance of the Heap
class
Signature
constructor(a: T[], comp: Comparer<T>);
Parameters
Parameter | Type | Description |
---|---|---|
a | T[] | |
comp | Comparer<T> |
Property Details
comp
Signature
comp: Comparer<T>;
Type: Comparer<T>
Method Details
add
Signature
add(x: T): void;
Parameters
Parameter | Type | Description |
---|---|---|
x | T |
count
Signature
count(): number;
Returns
Return type: number
get
Signature
get(): T;
Returns
Return type: T
peek
Signature
peek(): T;
Returns
Return type: T