English

An Optimal Choice Dictionary

Data Structures and Algorithms 2017-11-03 v1

Abstract

A choice dictionary is a data structure that can be initialized with a parameter n{1,2,}n\in\{1,2,\ldots\} and subsequently maintains an initially empty subset SS of {1,,n}\{1,\ldots,n\} under insertion, deletion, membership queries and an operation 'choice' that returns an arbitrary element of SS. The choice dictionary is fundamental in space-efficient computing and has numerous applications. The best previous choice dictionary can be initialized with nn and a second parameter t{1,2,}t\in\{1,2,\ldots\} in constant time and subsequently executes all operations in O(t)O(t) time and occupies n+O(n(t/w)t+logn)n+O(n({t/w})^t+\log n) bits on a word RAM with a word length of w=Ω(logn)w=\Omega(\log n) bits. We describe a new choice dictionary that, following a constant-time initialization, executes all operations in constant time and, in addition to the space needed to store nn, occupies only n+1n+1 bits, which is shown to be optimal if w=o(n)w=o(n). Allowed log2(n+1)\lceil\log_2(n+1)\rceil bits of additional space, the new data structure also supports iteration over the set SS in constant time per element.

Keywords

Cite

@article{arxiv.1711.00808,
  title  = {An Optimal Choice Dictionary},
  author = {Torben Hagerup},
  journal= {arXiv preprint arXiv:1711.00808},
  year   = {2017}
}
R2 v1 2026-06-22T22:34:13.556Z