Socket
Socket
Sign inDemoInstall

data-structures-javascript

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    data-structures-javascript

Library of Data Structures in Javascript


Version published
Weekly downloads
19
increased by1800%
Maintainers
1
Install size
98.1 kB
Created
Weekly downloads
 

Readme

Source

DataStructures

##To The Wiki License (MIT)

Usage

The spirit behind this project is to allow the use of classic data structures within Javascript applications, and to allow the storage of data types such as objects, functions, arrays, and even other instances of any kind of data structures (like a Linked List within a Graph). To accomplish this, most of the data structures here use an __id in place of the value for reference.

Considerations

This does use some basic ES6 features. You must use node 6.2.0 or higher, and some browsers may have difficulties without a transpiler.

NPM Install

You must use node 6.2.0 or higher

npm install data-structures-javascript

Then, in your Javascript files:
var DataStructures = require('data-structures-javascript')
var BinaryTree = DataStructures.BinaryTree
Create instances of each data structure by importing only the class you want.
For example:
var BinaryTree = require('data-structures-javascript').BinaryTree

Classes

Please checkout the Wiki to see usage of these classes.

Latest Update

Graph helper functions now can take a second parameter which limits the depth of the query/request (see the wiki).

Test

run mocha

Updates / Todo

  • Some classes use recursive calls which can potentially create a stack overflow depending on the environment. Replace recursive functions with loops.

Contributing

Please submit pull requests to github.com/tivrama

Keywords

FAQs

Last updated on 10 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc