While operations \emph{rank} and \emph{select} on static bitvectors can be supported in constant time, lower bounds show that supporting updates raises the cost per operation to $\Theta(\log n/ \log\log n)$. This is a shame in scenarios where updates are possible but uncommon. We develop a representation of bitvectors that supports all the operations in $O(\log(n/q))$ amortized time. Our experimental results support the theoretical findings, displaying speedups of orders of magnitude compared to standard dynamic implementations.
翻译:尽管静态位向量上的 \emph{rank} 和 \emph{select} 操作可在常数时间内实现,但下界分析表明支持更新操作会将每次操作的成本提升至 $\Theta(\log n/ \log\log n)$。这在更新可能发生但不频繁的场景中尤为可惜。我们提出了一种位向量表示方法,可在 $O(\log(n/q))$ 的摊分时间内支持所有操作。实验结果验证了理论发现,与标准动态实现相比获得了数量级的速度提升。