Skip to content
Eugene Lazutkin edited this page Jul 18, 2026 · 28 revisions

list-toolkit

CI NPM version

A toolkit for lists, related data structures, and their practical applications.

Search

🔍 Search this wiki — ranked, deep-linked search via wiki-search; install the bookmarklet to search in place. Fallback: GitHub wiki search.

Concepts

Lists are simple yet versatile, with many possible design trade-offs. Suggested reading order:

DLL: doubly linked lists

The most flexible variant. API reference:

  • Foundation — the foundational classes and methods of the implementation.
  • Lists — the hosted list classes and methods.
  • Pointers — the pointers API for doubly-linked lists.
  • External lists — the external headless lists API.

SLL: singly linked lists

Minimalist and most performant. API reference:

  • Foundation — the foundational classes and methods of the implementation.
  • Lists — the hosted list classes and methods.
  • Pointers — the pointers API for singly-linked lists.
  • External lists — the external headless lists API.

Unrolled list

List utilities

Caches

List-based caches with various eviction policies:

  • CacheLRU — a least recently used (LRU) cache.
  • CacheFIFO — a first in, first out (FIFO) cache.
  • CacheLFU — a least frequently used (LFU) cache.
  • CacheRandom — a cache with randomly removed items.
  • CacheSLRU — a segmented LRU (scan-resistant) cache.
  • CacheClock — a CLOCK (second chance) cache.

All caches share the same API but may have different options. See Caches.

Also provides a cache decorator for function/method results keyed by the first argument.

Heaps

Efficient min/max tracking:

Queue, Stack, and Deque

List-backed adapters:

Trees

Skip list

  • SkipList — a probabilistic ordered container with expected O(log n) operations and range scans. See Wiki's Skip list for more details.

Timer wheel

Free list

  • FreeList — an intrusive object pool for recycling nodes (GC-pressure control). See Wiki's Free list for more details.

Release history

  • Release notes — per-version release notes (canonical long-form; the README carries a cliff-notes summary).

Direct links

Direct links to files
Direct links to classes
  • Caches:
  • DLL:
    • Node — the foundational node class.
    • HeadNode — the class used by hosted DLL as the head node.
    • ValueNode — the class used by value-based DLL as the value node.
    • PtrBase — the base class for DLL pointers.
    • ExtListBase — the base class for DLL external lists.
    • List — the list class that implements node-based DLL.
    • ValueList — the list class that implements value-based DLL.
    • ExtList — the list class that implements an external headless node-based DLL.
    • ExtValueList — the list class that implements an external headless value-based DLL.
    • Ptr — the pointer class used by hosted DLL.
  • SLL:
    • Node — the foundational node class.
    • HeadNode — the class used by hosted SLL as the head node.
    • ValueNode — the class used by value-based SLL as the value node.
    • PtrBase — the base class for SLL pointers.
    • ExtListBase — the base class for SLL external lists.
    • SList — the list class that implements node-based SLL.
    • ValueSList — the list class that implements value-based SLL.
    • ExtSList — the list class that implements an external headless node-based SLL.
    • ExtValueSList — the list class that implements an external headless value-based SLL.
    • Ptr — the pointer class used by hosted SLL.
  • Heaps:
  • Queues:
    • Queue — the queue adapter class.
  • Stacks:
    • Stack — the stack adapter class.
  • Deques:
    • Deque — the deque adapter class.
    • RingBuffer — the array-backed deque class.
  • Trees:
  • Skip lists:
  • Timer wheels:
  • Free lists:
  • Unrolled lists:

Clone this wiki locally