data-structure-typed

website·Indexed 30 days ago

https://data-structure-typed-docs.vercel.app

A production-ready TypeScript/JavaScript data structures library with zero dependencies, featuring over 2600 tests and 99%+ coverage.

Tokens
384
Snippets
1
Records
7
Agent score
25%

What's inside data-structure-typed

  1. Overview of data-structure-typed

    data-structure-typed is a production-ready TypeScript/JavaScript data structures library with zero dependencies. It provides a comprehensive collection of 20+ data structures with a unified API similar to native JavaScript Arrays. Supported structures include Heap, Priority Queue, Deque, Trie, Graph, Red-Black Tree, TreeMap, TreeSet, SkipList, Segment Tree, Binary Indexed Tree, and Matrix. All structures support standard iteration and transformation methods: forEach, filter, map, reduce, every, some, find, entries, keys, and values.
  2. Perform order-statistic operations

    To efficiently find the kth element or determine the rank of a key, enable enableOrderStatistic: true and use the following methods: getRank(key), getByRank(k), and rangeByRank(start, end).
  3. Implement sorted collections with TreeMap and TreeSet

    Use TreeMap (key-value) or TreeSet (key-only) for sorted collections. These are backed by Red-Black Trees and provide O(log n) insertion while maintaining order. They implement a NavigableMap API including floor, ceiling, higher, lower, and rangeSearch.