English

Faster Linear-Space Data Structures for Path Frequency Queries

Data Structures and Algorithms 2026-04-22 v1

Abstract

We present linear-space data structures for several frequency queries on trees, namely: path mode, path least frequent element, and path α\alpha-minority queries. We present the first linear-space data structures, requiring O(nnw)O(n \sqrt{nw}) preprocessing time, that can answer path mode and path least frequent element queries in O(n/w)O(\sqrt{n/w}) time. This improves upon the best previously known bound of O(loglognn/w)O(\log\log n \sqrt{n/w}) achieved by Durocher et al. in 2016. For the path α\alpha-minority problem, where α\alpha is specified at query time, we reduce the query time of the linear-space data structure of Durocher et al. from O(α1loglogn)O(\alpha^{-1}\log\log n) down to O(α1)O(\alpha^{-1}) by employing a simple randomized algorithm with a success probability 1/2\geq 1/2. We also present the first linear-space data structure supporting "Path Maximum gg-value Color" queries in O(n/w)O(\sqrt{n/w}) time, requiring O(nnw)O(n \sqrt{nw}) preprocessing time. This general framework encapsulates both path mode and path least frequent element queries. For our data structures, we consider the word-RAM model with wΩ(logn)w\in \Omega(\log n), where ww is the word size in bits.

Keywords

Cite

@article{arxiv.2604.18667,
  title  = {Faster Linear-Space Data Structures for Path Frequency Queries},
  author = {Ovidiu Rata},
  journal= {arXiv preprint arXiv:2604.18667},
  year   = {2026}
}
R2 v1 2026-07-01T12:26:49.540Z