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

js-sdsl

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-sdsl

javascript standard data structure library which benchmark against C++ STL

  • 4.1.5-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
decreased by-62.79%
Maintainers
2
Weekly downloads
 
Created

What is js-sdsl?

The js-sdsl package is a JavaScript library that provides a variety of data structures and algorithms. It is designed to be efficient and easy to use, offering structures like vectors, lists, queues, stacks, and trees, as well as algorithms for sorting, searching, and other operations.

What are js-sdsl's main functionalities?

Vector

Vector is a dynamic array that can grow and shrink in size. It provides random access to elements, similar to an array.

const { Vector } = require('js-sdsl');
let vector = new Vector();
vector.pushBack(1);
vector.pushBack(2);
console.log(vector.size()); // Output: 2

LinkedList

LinkedList is a sequence of elements where each element points to the next. It allows for efficient insertion and removal of elements from any position.

const { LinkedList } = require('js-sdsl');
let linkedList = new LinkedList();
linkedList.pushBack(1);
linkedList.pushFront(0);
console.log(linkedList.front()); // Output: 0

Queue

Queue is a first-in-first-out (FIFO) data structure that allows for efficient addition of elements at the end and removal from the front.

const { Queue } = require('js-sdsl');
let queue = new Queue();
queue.push(1);
queue.push(2);
console.log(queue.front()); // Output: 1

Stack

Stack is a last-in-first-out (LIFO) data structure that allows for adding and removing elements from the top of the stack.

const { Stack } = require('js-sdsl');
let stack = new Stack();
stack.push(1);
stack.push(2);
console.log(stack.top()); // Output: 2

Tree

Tree structures like AVLTree are used to store data in a hierarchical manner. AVLTree is a self-balancing binary search tree.

const { AVLTree } = require('js-sdsl');
let tree = new AVLTree();
tree.insert(1);
tree.insert(2);
console.log(tree.find(1)); // Output: true

Other packages similar to js-sdsl

Keywords

FAQs

Package last updated on 23 Sep 2022

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