Package Exports
- js-ds-collection
Readme
js-ds-collection
A lightweight, modular, and TypeScript-first collection of commonly used data structures in JavaScript, built for learning, practice, and production use.
โจ Features
- ๐งฑ Classic data structures like Stack, Queue, LinkedList, Heap, Tree, Trie, Union-Find, Segment Tree
- โก Fully type-safe with TypeScript generics
- ๐งช 100% unit-tested with Vitest
- ๐ฆ Tree-shakable and ready for modern builds
- ๐ Great for DSA practice, interviews, or educational use
๐ฆ Installation
npm install js-ds-collection
Data Structures table of Contents
Data Structure | Description | Docs / Examples |
---|---|---|
Stack<T> |
LIFO structure with iterable support | ๐ Stack Docs |
Queue<T> |
Optimized FIFO queue using circular buffer | ๐ Queue Docs |
Dequeue<T> |
Insert/remove from both ends | ๐ Dequeue Docs |
LinkedList<T> |
Singly linked list | ๐ LinkedList Docs |
DoublyLinkedList<T> |
Bi-directional linked list | ๐ DoublyLinkedList Docs |
CircularLinkedList<T> |
Circular linked list | ๐ DoublyLinkedList Docs |
Heap<T> |
Generic min/max heap via comparator | ๐ Heap Docs |
UnionFind |
Disjoint-set with union by rank/size | ๐ UnionFind Docs |
SegmentTree<T> |
Fast range queries and point updates | ๐ SegmentTree Docs |
Trie |
Prefix tree for string search | ๐ Trie Docs |