Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datastructures-js

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datastructures-js

production-ready data structures implementation in javascript & typescript.

  • 13.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
increased by87.41%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 20 Jun 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc