English

Optimal Static Dictionary with Worst-Case Constant Query Time

Data Structures and Algorithms 2025-03-28 v2

Abstract

In this paper, we design a new succinct static dictionary with worst-case constant query time. A dictionary data structure stores a set of key-value pairs with distinct keys in [U][U] and values in [σ][\sigma], such that given a query x[U]x\in [U], it quickly returns if xx is one of the input keys, and if so, also returns its associated value. The textbook solution to dictionaries is hash tables. On the other hand, the (information-theoretical) optimal space to encode such a set of key-value pairs is only OPT:=log(Un)+nlogσ\text{OPT} := \log\binom{U}{n}+n\log \sigma. We construct a dictionary that uses OPT+nϵ\text{OPT} + n^{\epsilon} bits of space, and answers queries in constant time in worst case. Previously, constant-time dictionaries are only known with OPT+n/polylogn\text{OPT} + n/\text{poly}\log n space [P\v{a}tra\c{s}cu 2008], or with OPT+nϵ\text{OPT}+n^{\epsilon} space but expected constant query time [Yu 2020]. We emphasize that most of the extra nϵn^{\epsilon} bits are used to store a lookup table that does not depend on the input, and random bits for hash functions. The "main" data structure only occupies OPT+polylogn\text{OPT}+\text{poly}\log n bits.

Keywords

Cite

@article{arxiv.2412.10655,
  title  = {Optimal Static Dictionary with Worst-Case Constant Query Time},
  author = {Yang Hu and Jingxun Liang and Huacheng Yu and Junkai Zhang and Renfei Zhou},
  journal= {arXiv preprint arXiv:2412.10655},
  year   = {2025}
}

Comments

31 pages, 4 figures, in STOC 2025

R2 v1 2026-06-28T20:34:57.426Z