• Stars
    star
    203
  • Rank 185,854 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

✳️ consolidates all data structures into a single repository

npm npm npm

consolidates all data structures @datastructures-js into a single repository.

install

npm install --save datastructures-js

require

const {
  Stack,
  Queue,
  Deque,
  EnhancedSet,
  LinkedList, LinkedListNode, DoublyLinkedList, DoublyLinkedListNode,
  Heap, MinHeap, MaxHeap,
  PriorityQueue, MinPriorityQueue, MaxPriorityQueue,
  BinarySearchTree, BinarySearchTreeNode, AvlTree, AvlTreeNode,
  Trie, TrieNode,
  Graph, DirectedGraph,
} = require('datastructures-js');

import

import {
  Stack,
  Queue,
  Deque,
  EnhancedSet,
  LinkedList, LinkedListNode, DoublyLinkedList, DoublyLinkedListNode,
  Heap, MinHeap, MaxHeap,
  PriorityQueue, MinPriorityQueue, MaxPriorityQueue,
  BinarySearchTree, BinarySearchTreeNode, AvlTree, AvlTreeNode,
  Trie, TrieNode,
  Graph, DirectedGraph,
} from 'datastructures-js';

extend

Data structures are implemented as ES6 classes (with types definitions) for general purposes. They can be extended for additional functionality and custom requirements.

const { Graph } = require('datastructures-js'); // OR require('@datastructures-js/graph')

class CustomGraph extends Graph {
  findShortestPath(pointA, pointB) {
    // more code
  }
}

Build

grunt build

License

The MIT License. Full License is here