Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-structures

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-structures - npm Package Compare versions

Comparing version 3.1.4 to 4.0.0

lib/priorityQueue.js

1

index.js
module.exports.Stack = require('./lib/stack');
module.exports.Queue = require('./lib/queue');
module.exports.PriorityQueue = require('./lib/priorityQueue');
module.exports.LinkedList = require('./lib/linkedList');

7

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc