A lightweight, modular, and TypeScript-first collection of commonly used data structures in JavaScript, built for learning, practice, and production use.
- 🧱 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
npm install js-ds-collection| 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 |