js-ds-collection
v1.0.5
Published
A collection of clean, testable data structures in modern TypeScript
Maintainers
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-collectionData 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 |
