Rank-Select Indices Without Tears

Abstract

A rank-select index for a sequence B=(b1,…,bn) of n bits is a data structure that, if provided with an operation to access ( n) arbitrary consecutive bits of B in constant time (thus B is stored outside of the data structure), can compute rankB(j)=Σi=1j bi for given j∈\0,…,n\ and selectB(k)=\j:rankB(j) k\ for given k∈\1,…,Σi=1n bi\. We describe a new rank-select index that, like previous rank-select indices, occupies O(n n/ n) bits and executes rank and select queries in constant time. Its derivation is intended to be particularly easy to follow and largely free of tedious low-level detail, its operations are given by straight-line code, and we show that it can be constructed in O(n/ n) time.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…