Skip to content

Dynamic Entropy-Encoded Arrays in O(1) Time with Nearly Optimal Space

Guy E. Blelloch, Yang Hu, William Kuszmaul, Tianxiao Li, Renfei Zhou

cs.DSarXiv:2608.06066

Abstract

We show how to implement a dynamic array A[1, n] with symbols from a fixed alphabet Σ, while supporting O(1)-time queries and updates, and using a total space of |Σ|m + (1 + O( n n)) · (Σσ∈ Σ fσ (n / fσ)) + n / polylog n bits, where fσ denotes the frequency of each symbol σ∈ Σ and m denotes the number of distinct symbols with non-zero frequencies. This resolves a long-standing open question as to whether one can achieve space bounds close to that of arithmetic coding, while supporting O(1)-time operations, whenever the entropy is at least n/polylog n. We also prove a nearly matching space lower bound: up to a factor of O( n), the entropy-dependent multiplicative overhead of our construction is optimal among O(1)-time solutions when |Σ|=O( n) and the entropy Σσ∈ Σ fσ (n / fσ) lies between n/O(1)n and (1/100)n n. Finally, we present several applications of our results, resolving two open problems having to do with space-efficient dictionaries and filters.

Create a lesson