node-structures
Advanced tools
Comparing version 3.1.4 to 4.0.0
module.exports.Stack = require('./lib/stack'); | ||
module.exports.Queue = require('./lib/queue'); | ||
module.exports.PriorityQueue = require('./lib/priorityQueue'); | ||
module.exports.LinkedList = require('./lib/linkedList'); |
{ | ||
"name": "node-structures", | ||
"version": "3.1.4", | ||
"version": "4.0.0", | ||
"author": { | ||
@@ -14,8 +14,5 @@ "name": "Albert Hambardzumyan", | ||
"Data Structures", | ||
"Data-Structures", | ||
"Stack", | ||
"stack", | ||
"Queue", | ||
"queue", | ||
"LinkedList", | ||
"Priority Queue", | ||
"Linked List" | ||
@@ -22,0 +19,0 @@ ], |
@@ -15,2 +15,3 @@ # node-structures | ||
* [Queue](#queue) | ||
* [Priority Queue](#linkedlist) | ||
* [Linked List](#linkedlist) | ||
@@ -111,2 +112,44 @@ | ||
###Priority Queue | ||
```` javascript | ||
const PriorityQueue = require('node-structures').PriorityQueue; | ||
let priorityQueue = new PriorityQueue(); | ||
/** | ||
* Returns the number of elements in this collection | ||
* | ||
* @returns {Number} - the number of elements in this collection | ||
*/ | ||
priorityQueue.size(); | ||
/** | ||
* Tests if this priority queue is empty. | ||
* | ||
* @returns {boolean} - true if and only if this priority queue contains no items; false otherwise. | ||
*/ | ||
priorityQueue.isEmpty(); | ||
/** | ||
* Inserts the specified element into this priority queue. | ||
* | ||
* @param element - the element to add | ||
* @returns {boolean} Returns true | ||
*/ | ||
priorityQueue.add(40); | ||
/** | ||
* Retrieves and removes the head of this priority queue, or returns null if this priority queue is empty. | ||
* | ||
* @returns {*} Returns the head of this priority queue, or null if this priority queue is empty. | ||
*/ | ||
priorityQueue.poll(); | ||
/** | ||
* Retrieves, but does not remove, the head of this priority queue, or returns null if this priority queue is empty. | ||
* | ||
* @returns {*} Returns the head of this priority queue, or null if this priority queue is empty. | ||
*/ | ||
priorityQueue.peek(); | ||
```` | ||
###LinkedList | ||
@@ -113,0 +156,0 @@ ```` javascript |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32930
16
712
218