Code Monkey home page Code Monkey logo

js-data-structs's Introduction

JS data structs

npm bundle size Codecov

A small data structures and algorithms library for JavaScript.

Installing

NPM package

npm i js-data-structs

NPM page

CDN

https://cdn.jsdelivr.net/npm/js-data-structs@latest/dist/js-data-structs.umd.js

jsDeliver

Implemented Data structures/ Algos-

Expand
  • Trees
    • Binary Trees
    • Binary Search Trees
  • Stack
  • Queue
    • Priority Queue
  • Graph
    • BFS
    • DFS
    • Topological Sort
    • Dijkstra's Algorithm
  • Trie
  • Power set
  • Heap's algorithm (array permutations)
  • Linked List
  • Doubly Linked List
  • Heap Sort
    • Max heap
    • Min heap
  • Z algorithm (pattern matching)
  • N Queens
  • LZW
    • Encoding
    • Decoding
  • Fisher–Yates shuffle Algorithm
  • Binary Search
  • Rabin Karp
  • Levenshtein Distance

Contributing

Before contributing please read CONTRIBUTING.md for guidelines.

In addition to the guidelines mentioned in CONTRIBUTING.md there are some additional things to keep in mind while raising pull requests. Before your pull request can be accepted there are some checks that have to pass. To run these checks locally-

  • npm run prepare to compile with Rollup and Babel
  • npm run format to format with Prettier
  • npm run lint to check for linting errors
  • npm test to run the Jest unit tests

New algorithms or data structures are added to ./src/ and you also have to add test cases for all functions implemented in the ./test/ folder.

Future features

Expand
  • Minified version

  • Linked List

    • Circular Linked List
    • Doubly Linked List
  • Heapsort

    • Max heap
    • Min heap
  • Suffix trees

  • More Graph algorithms

    • Topological Sort
    • Dijkstra's Algorithm
  • LZW

    • Encoding
    • Decoding

js-data-structs's People

Contributors

andresruizdc avatar aveek-saha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mustaphee

js-data-structs's Issues

Add Suffix trees

Suffix trees -

What will change -
The suffix tree data structure will be added

Describe the solution you'd like
The suffix tree should be able to find all occurrences of a pattern in a string

Add doubly linked list

Doubly linked list -

What will change -
Add doubly linked lists

Describe the solution you'd like
You should be able to

  • insert node at head
  • insert node at tail
  • insert at given index
  • get node at given index
  • delete from given index
  • delete node at head
  • delete node at tail
  • display list as string

Cover more algorithms and data structures

Looking for contributors to add new algorithms and data structures to this library. Algorithms that have real use cases are preferred. For example, no point in adding insertion sort when the default search function is going to be faster.

If you want to contribute, please raise a new issue and if you want to work on it as well, wait for me to assign it to you. Once assigned, create a new Pull Request with your changes.

Please read the contributing guidelines before you start

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.