Skip to content
Hรฉla Ben Khalfallah edited this page Nov 10, 2024 · 3 revisions

Welcome to DSA Toolbox ๐Ÿ“š

Welcome to DSA Toolbox, a comprehensive library of data structures and algorithms designed to streamline your development process! This library is built for JavaScript and TypeScript, offering both fundamental and advanced data structures, search algorithms, sort algorithms, and more.

Whether you're building a lightweight application or handling large datasets, DSA Toolbox provides an optimized library to make your coding journey efficient and fun.


๐ŸŒŸ Features

DSA Toolbox offers a variety of powerful toolbox:

๐Ÿ”Ž Search Algorithms

  • Binary Search
  • Exponential Search
  • Hybrid Search
  • Linear Search
  • Ternary Search

๐Ÿงฎ Sort Algorithms

  • HeapSort
  • MergeSort
  • TimSort

๐Ÿ”„ Cache Algorithms

  • LFU (Least Frequently Used)
  • LRU (Least Recently Used)

๐Ÿ—๏ธ Data Structures

  • Heaps: MaxHeap, MinHeap
  • Linked Lists: Singly Linked List, Doubly Linked List
  • Queues & Stacks
  • Treaps (Binary Search Tree with heap properties)
  • Trees: AVL Tree, Red-Black Tree, Binary Search Tree, B-Tree, Trie
  • Probabilistic Structures: Bloom Filter, HyperLogLog, CountMinSketch, SkipList, MinHash, SimHash, TDigest

๐Ÿ› ๏ธ Usage

To install the DSA Toolbox:

pnpm add dsa-toolbox 

Then you can import the Data Structure or the Algorithm you want to use:

import {
  binarySearch,
  exponentialSearch,
  hybridSearch,
  linearSearch,
  ternarySearch,
  heapSort,
  mergeSort,
  timSort,
  LFUCache,
  LRUCache,
  MaxHeap,
  MinHeap,
  DoublyLinkedList,
  LinkedList,
  HyperLogLog,
  CountMinSketch,
  BloomFilter,
  SkipList,
  TDigest,
  MinHash,
  SimHash,
  Queue,
  Stack,
  Treap,
  AVLTree,
  BTree,
  BinarySearchTree,
  RedBlackTree,
  Trie,
} from 'dsa-toolbox';

binarySearch(sortedData, target, { compareFn: (a, b) => a - b, isSorted: true });
ternarySearch(data, target, 0, sortedData.length - 1, {
        compareFn: (a, b) => a - b,
        isSorted: false,
    });

const queue = new Queue<number>();
data.forEach((item) => queue.enqueue(item));

const avlTree = new AVLTree<number>();
avlTree.insert(10);
avlTree.insert(20);
avlTree.insert(5);
avlTree.insert(4);
avlTree.insert(15);
avlTree.search(10);

More usage examples can be found here:


๐Ÿ“– Documentation

For detailed explanations of each data structure and algorithm, please visit:


โšก Why DSA Toolbox?

The goal of DSA Toolbox is to provide high-performance and versatile solutions for everyday programming needs. Whether you're building applications that require fast search and sort, or you're working with large datasets and need to optimize storage, DSA Toolbox has you covered.


๐Ÿ’ฌ Support & Feedback

If you have any questions or need support, feel free to:

  • Open an issue on GitHub
  • Reach out through discussions

๐Ÿ“œ License

DSA Toolbox is open-source and available under the MIT License.


๐Ÿš€ Contributing

For contributions, we invite you to read our Contributing Guide to get started and ensure a smooth process.


Let's code smarter and more efficiently with DSA Toolbox! ๐ŸŽ‰