Giter VIP home page Giter VIP logo

js-data-structures's Introduction

js-data-structures

Build Status

A collection of data structures written in JavaScript.

Detailed information on the complexity of each data structure is located here. To learn more about how some of the data structures are implemented, check out the technical articles on Growing with the Web.

Installing

npm install --save js-data-structures

Including

var AvlTree = require('js-data-structures').AvlTree;
var BinaryHeap = require('js-data-structures').BinaryHeap;
var BinarySearchTree = require('js-data-structures').BinarySearchTree;
var BinomialHeap = require('js-data-structures').BinomialHeap;
var FibonacciHeap = require('js-data-structures').FibonacciHeap;
var RedBlackTree = require('js-data-structures').RedBlackTree;
var SplayTree = require('js-data-structures').SplayTree;

Usage

See the source files and dependencies in package.json for a list of public interfaces on each data structure, here is an example for the Fibonacci heap.

var heap = new FibonacciHeap();
heap.insert(3);
heap.insert(7);
heap.insert(8);
heap.insert(1);
heap.insert(2);

while (!heap.isEmpty()) {
  console.log(heap.extractMinimum());
}

Contributing

I'd love to get some contributions for other data structures, if you want to make a pull request try to follow the existing style of the code and make sure you add tests for the new data structure.

Testing locally

npm install
npm test

# generate coverage report in ./coverage/
grunt coverage

License

MIT © Daniel Imms

See also

js-data-structures's People

Contributors

tyriar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.