Skip to content
Preprint

Average-Case Optimal Encodings and Efficient Worst-Case Indices for Element Distinctness Queries

Aug 2026 · 0 citations · 31 references
Computer Science

TL;DR

This work studies the data structure version of the data structure version of the All-Distinct queries, and proves a cell-probe space-time tradeoff lower bound showing that any index using $n/b$ bits must have $\Omega(b/\log{b})$ query time.

Abstract

We study the data structure version of the \emph{element distinctness problem}: preprocess an array of $n$ elements from an alphabet of size $\sigma$ to answer \textsc{All-Distinct} queries, asking whether a given range contains only distinct elements. We first focus on \emph{uniformly random arrays}: in the encoding model, where access to the input at query time is not allowed, we prove a lower bound on the expected space; for instance, the lower bound is $n$, $1.3627n$, $1.5153n$, $1.5824n$ bits for $\sigma = 2,3,4,5$, and approximately $n\sqrt{\pi/(2\sigma)}\,\log\sigma$ bits for $\sigma =\omega(1)$. We complement this by designing different average-case optimal encodings, supporting \textsc{All-Distinct} queries in worst-case time $O(1)$, $o(\log^{2}{\log{n}})$, or $O(\log\log{n})$ depending on $\sigma$, and $O(1)$ expected time for any $\sigma = \omega(1)$. We then switch to worst-case (non-random) arrays: in the indexing model, where access to the input is allowed, we prove a cell-probe space-time tradeoff lower bound showing that any index using $n/b$ bits must have $\Omega(b/\log{b})$ query time. We conclude by presenting a simple index almost matching this lower bound.

View source

Similar papers

Preprint Aug 2026

Cell-Probe Lower Bounds and Complexity-Preserving Reductions for Suffix Array Queries

For a text $T$ of length $n$ over an alphabet of size $\sigma$, its suffix array lists the starting positions of the suffixes of $T$ in lexicographic order, and its inverse suffix array gives the lexicographic rank of the suffix starting at each position. Since the introduction of the FM-index and the compressed suffix...

Dominik Kempa, Tomasz Kociumaka · 1 citation
Preprint Sep 2026

Union-Find with Constant-Time Deletions Across the Optimal Worst-Case Tradeoff

We consider union-find with deletions, where the representation and the cost of a query must depend on the current number of live elements rather than on the number of elements ever created. For every integer parameter $k\ge 2$, we give a linear-space data structure supporting $\mathsf{MakeSet}$ in $O(1)$ worst-case ti...

Han-Qing Li, Ze Hong · 0 citations
Preprint Aug 2026

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

We show how to implement a dynamic array $A[1, n]$ with symbols from a fixed alphabet $\Sigma$, while supporting $O(1)$-time queries and updates, and using a total space of $$ \log \binom{|\Sigma|}{m} + \left(1 + O\left(\frac{\log \log n}{\log n}\right)\right) \cdot \left(\sum_{\sigma \in \Sigma} f_\sigma \log (n / f_\...

G. Blelloch, Yang Hu, William Kuszmaul et al. · 2 citations
Preprint Sep 2026

Query Complexity of Testing Structured Parenthesis Languages

We study the query complexity of testing membership in structured string languages, focusing on Dyck languages and natural generalizations. A tester receives query access to a word and must distinguish valid inputs from words that are far in Hamming distance, while inspecting only a sublinear number of positions. Our r...

Tim Jackman, Diptaksho Palit, Sofya Raskhodnikova · 0 citations
Preprint Aug 2026

Optimal Time-Space Tradeoff for Dynamic Difference-Encoded Dictionaries

A dynamic dictionary is constructed that supports operations in $O(\log\varepsilon^{-1}/\log\log\varepsilon^{-1})$ expected amortized time and uses bits of space, and proves a matching lower bound, showing that the time-space tradeoff is optimal even in the \emph{static} case.

G. Blelloch, Yang Hu, William Kuszmaul et al. · 1 citation
Preprint Aug 2026

Partially-Dynamic All-Pairs Maxflow and Effective Resistance via Stable Sparsifiers

A randomized data structure for undirected weighted graphs that are partially dynamic, i.e., that undergo either only edge insertions or only edge deletions is given, which follows from a simple stability principle for partially dynamic graphs.

Gramoz Goranci, Rasmus Kyng, Maximilian Probst Gutenberg et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.