Relaxed Radix Balanced Trees: Efficient Immutable Vectors

2025-02-19

This article introduces Relaxed Radix Balanced (RRB) trees, a data structure designed for efficient immutable vector implementation. Unlike persistent vectors, RRB trees offer significant performance advantages in merge operations. The article delves into the workings of RRB trees, explaining the core concept of relaxing the left-dense constraint and how a size table and the M..M-1 invariant ensure efficient lookups and merges. A TypeScript implementation is provided, along with a detailed explanation of the merge algorithm, showcasing RRB trees' efficiency in practice.

Development immutable vectors