# Compact Fenwick trees for dynamic ranking and selection

**Authors:** Stefano Marchini, Sebastiano Vigna

arXiv: 1904.12370 · 2019-10-15

## TL;DR

This paper introduces optimized variants of Fenwick trees that reduce space and improve predecessor search speed, enabling efficient dynamic bit vectors with minimal overhead and better performance than existing structures.

## Contribution

The paper presents novel Fenwick tree variants that reduce size and accelerate predecessor searches, enhancing dynamic bit vector operations.

## Key findings

- Reduced Fenwick tree size with known upper bounds
- Faster predecessor search algorithms
- Efficient dynamic bit vector implementation with minimal space overhead

## Abstract

The Fenwick tree is a classical implicit data structure that stores an array in such a way that modifying an element, accessing an element, computing a prefix sum and performing a predecessor search on prefix sums all take logarithmic time. We introduce a number of variants which improve the classical implementation of the tree: in particular, we can reduce its size when an upper bound on the array element is known, and we can perform much faster predecessor searches. Our aim is to use our variants to implement an efficient dynamic bit vector: our structure is able to perform updates, ranking and selection in logarithmic time, with a space overhead in the order of a few percents, outperforming existing data structures with the same purpose. Along the way, we highlight the pernicious interplay between the arithmetic behind the Fenwick tree and the structure of current CPU caches, suggesting simple solutions that improve performance significantly.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1904.12370/full.md

## Figures

25 figures with captions in the complete paper: https://tomesphere.com/paper/1904.12370/full.md

## References

15 references — full list in the complete paper: https://tomesphere.com/paper/1904.12370/full.md

---
Source: https://tomesphere.com/paper/1904.12370