1.2.36 • Published 5 years ago

@clarketm/superheap v1.2.36

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

Heap

NPM release

Heap with superpowers! 💪

Individual Module Installation

Yarn

$ yarn add @clarketm/superheap

Npm

$ npm install @clarketm/superheap --save

API

constructor(iterable: Array<Item>, comparator: Comparator)

Construct a Heap

size: number

Get the current size of the heap

max: Item

Get the maximum item in heap

min: Item

Get the minimum item in heap

isEmpty(): boolean

Check if heap is empty

clear(): void

Clear the items from the heap

insert(value: Item): number

Insert an item into the heap

NameTypeAttributeDescription
valueItemitem to insert

deleteMax(): Item

Remove and return the maximum item

deleteMin(): Item

Remove and return the minimum item

toArray(): Array<Item>

Convert the heap to an array

1.2.36

5 years ago

1.2.35

5 years ago

1.2.32

5 years ago

1.2.31

6 years ago

1.2.25

6 years ago

1.2.20

6 years ago

1.2.18

6 years ago