Wondering what’s next for npm?Check out our public roadmap! »

    datastructures-js

    10.0.0 • Public • Published

    build:? npm npm npm

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

    Table of Contents

    install

    npm install --save datastructures-js

    API

    require

    const {
      Stack,
    
      Queue,
    
      Set as EnhancedSet, // renamed to avoid conflict with es6 Set
    
      LinkedList,
      LinkedListNode,
      DoublyLinkedList,
      DoublyLinkedListNode,
    
      MinHeap,
      MaxHeap,
    
      MinPriorityQueue,
      MaxPriorityQueue,
    
      BinarySearchTree,
      BinarySearchTreeNode,
      AvlTree,
      AvlTreeNode,
    
      Trie,
    
      Graph,
      DirectedGraph,
    } = require('datastructures-js');

    import

    import {
      Stack,
    
      Queue,
    
      Set as EnhancedSet, // renamed to avoid conflict with es6 Set
    
      LinkedList,
      LinkedListNode,
      DoublyLinkedList,
      DoublyLinkedListNode,
    
      MinHeap,
      MaxHeap,
    
      MinPriorityQueue,
      MaxPriorityQueue,
    
      BinarySearchTree,
      BinarySearchTreeNode,
      AvlTree,
      AvlTreeNode,
    
      Trie,
    
      Graph,
      DirectedGraph,
    } from 'datastructures-js';

    extend

    Data structures are implemented here as ES6 classes for general purposes. You can extend any of these classes to add/change any functionality in your code.

    const { Graph } = require('datastructures-js'); // OR require('@datastructures-js/graph')
    
    class CustomGraph extends Graph {
      findShortestPath(pointA, pointB) {
        // code
      }
    }

    Repositories

    Stack

    https://github.com/datastructures-js/stack

    Queue

    https://github.com/datastructures-js/queue

    Linked List (Single/Doubly)

    https://github.com/datastructures-js/linked-list

    Set

    https://github.com/datastructures-js/set

    Heap (Min/Max)

    https://github.com/datastructures-js/heap

    Priority Queue (Min/Max)

    https://github.com/datastructures-js/priority-queue

    Binary Search Tree (BST/AVL)

    https://github.com/datastructures-js/binary-search-tree

    Trie

    https://github.com/datastructures-js/trie

    Graph (Directed/Undirected)

    https://github.com/datastructures-js/graph

    Build

    grunt build
    

    License

    The MIT License. Full License is here

    Install

    npm i datastructures-js

    DownloadsWeekly Downloads

    121

    Version

    10.0.0

    License

    MIT

    Unpacked Size

    9.21 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar