Socket
Socket
Sign inDemoInstall

mnemonist

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mnemonist - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

docs/fibonacci-heap.md

5

CHANGELOG.md
# Changelog
## 0.3.0
* Adding `FibonacciHeap`.
* Fixing bug related to `Heap`.
## 0.2.0

@@ -4,0 +9,0 @@

4

docs/heap.md

@@ -53,3 +53,3 @@ # Heap

```js
var heap = new heap();
var heap = new Heap();

@@ -74,3 +74,3 @@ heap.push(4);

```js
var heap = new heap();
var heap = new Heap();

@@ -77,0 +77,0 @@ heap.push(34);

@@ -20,3 +20,2 @@ # Trie

* [#.longestPrefix](#longestprefix)
* [#.toObject](#toobject)

@@ -23,0 +22,0 @@ ### #.size

@@ -7,27 +7,8 @@ /**

*/
var comparators = require('./utils/heap-comparators.js');
/**
* Defaults.
*/
var DEFAULT_COMPARATOR = function(a, b) {
if (a < b)
return -1;
if (a > b)
return 1;
var DEFAULT_COMPARATOR = comparators.DEFAULT_COMPARATOR,
DEFAULT_REVERSED_COMPARATOR = comparators.DEFAULT_REVERSED_COMPARATOR;
return 0;
};
/**
* Function used to reverse a comparator.
*/
function reverseComparator(comparator) {
return function(a, b) {
return comparator(b, a);
};
}
var DEFAULT_REVERSED_COMPARATOR = reverseComparator(DEFAULT_COMPARATOR);
/**
* Binary Minimum Heap.

@@ -152,2 +133,5 @@ *

Heap.prototype.pop = function() {
if (!this.size)
return undefined;
var item = this.items[0],

@@ -154,0 +138,0 @@ last = this.items.pop();

@@ -9,4 +9,6 @@ /**

module.exports = {
Heap: require('./heap.js'),
LinkedList: require('./linked-list.js'),
Stack: require('./stack.js')
Stack: require('./stack.js'),
Trie: require('./trie.js')
};
{
"name": "mnemonist",
"version": "0.2.0",
"version": "0.3.0",
"description": "Collection of classic data structures for JavaScript.",

@@ -13,2 +13,4 @@ "main": "index.js",

"docs",
"utils",
"fibonacci-heap.js",
"heap.js",

@@ -28,2 +30,3 @@ "index.js",

"heap",
"fibonacci heap",
"stack",

@@ -30,0 +33,0 @@ "queue",

@@ -22,2 +22,3 @@ [![Build Status](https://travis-ci.org/Yomguithereal/mnemonist.svg)](https://travis-ci.org/Yomguithereal/mnemonist)

* [Fibonacci Heap](docs/fibonacci-heap.md)
* [Heap](docs/heap.md)

@@ -24,0 +25,0 @@ * [Linked List](docs/linked-list.md)

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