DSA-X: Data Structures for JavaScript

A robust, modular, and type-safe implementation of essential data structures. Built with TypeScript for developers who value clean, production-ready code.

$ npm install dsa-x
or: yarn add dsa-x / pnpm add dsa-x

Why Choose DSA-X?

Everything you need for efficient data structure implementations.

Lightweight
Minimal bundle size with zero dependencies. Only what you need.
Type-Safe
Full TypeScript support with comprehensive type definitions.
Performance
Optimized for speed and memory efficiency across all structures.
Well Documented
Clear documentation with examples for every data structure.
Battle-Tested
Used in production by developers worldwide.
Open Source
Community-driven development. Contributions welcome.

Data Structures

Explore 16 production-ready data structure implementations.

DynamicArray
Arrays
1 / 16

Resizable array with automatic expansion

Operations:

push(), pop(), get(), set(), remove()

Use Case:

Dynamic collections, replacing fixed arrays

import { DynamicArray } from 'dsa-x'; const arr = new DynamicArray();

Available Data Structures

Arrays

  • DynamicArray
  • SparseArray

Linked Lists

  • SinglyLinkedList
  • DoublyLinkedList

Stacks

  • Stack

Queues

  • Queue
  • PriorityQueue
  • CircularQueue

Sets

  • HashSet

Graphs

  • Graph
  • WeightedGraph

Trees

  • BinarySearchTree
  • AVLTree
  • Trie
  • MinHeap
  • MaxHeap

Quick Start

Get up and running with just a few lines of code.

Installation
Install from npm in seconds
$ npm install dsa-x

JavaScript Example

import { Stack, Queue, HashMap } from 'dsa-x';

// Using Stack
const stack = new Stack();
stack.push(1);
stack.push(2);
console.log(stack.pop()); // 2

// Using Queue
const queue = new Queue();
queue.enqueue('first');
queue.enqueue('second');
console.log(queue.dequeue()); // 'first'

// Using HashMap
const map = new HashMap();
map.set('name', 'John');
console.log(map.get('name')); // 'John'

TypeScript Example

import { Stack, Queue, HashMap } from 'dsa-x';

const stack: Stack<number> = new Stack();
const queue: Queue<string> = new Queue();
const map: HashMap<string, number> = new HashMap();

stack.push(42);
queue.enqueue('task');
map.set('count', 100);
1M+
Downloads
10K+
GitHub Stars
100%
TypeScript