Socket
Socket
Sign inDemoInstall

datastructures-js

Package Overview
Dependencies
10
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

datastructures-js

production-ready data structures implementation in javascript & typescript.


Version published
Maintainers
1
Weekly downloads
616
decreased by-85.89%

Weekly downloads

Readme

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

Last updated on 20 Jun 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc