1.0.13 • Published 3 years ago

priority-queue-v2 v1.0.13

Weekly downloads
176
License
ISC
Repository
github
Last release
3 years ago

priority-queue-v2

Published at - https://www.npmjs.com/package/priority-queue-v2

queue - add an element to the queue dequeue - delete the max priority element from the queue isEmpty - returns true/false clear - clear the queue delete - If we need to update the priority, delete that item and insert it in again list - contents of heap

The Item stored in the queue should be class and a comparator should be provided. By default, duplicate elements are not allowed. To allow duplicates in the queue add the allowDuplicates argument to true. let obj = new PriorityQueue(comparator, true)

let comparator = function (a, b) { return a >= b ? false : true }

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago