English

Lazy Search Trees

Data Structures and Algorithms 2020-10-20 v1

Abstract

We introduce the lazy search tree data structure. The lazy search tree is a comparison-based data structure on the pointer machine that supports order-based operations such as rank, select, membership, predecessor, successor, minimum, and maximum while providing dynamic operations insert, delete, change-key, split, and merge. We analyze the performance of our data structure based on a partition of current elements into a set of gaps {Δi}\{\Delta_i\} based on rank. A query falls into a particular gap and splits the gap into two new gaps at a rank rr associated with the query operation. If we define B=iΔilog2(n/Δi)B = \sum_i |\Delta_i| \log_2(n/|\Delta_i|), our performance over a sequence of nn insertions and qq distinct queries is O(B+min(nloglogn,nlogq))O(B + \min(n \log \log n, n \log q)). We show BB is a lower bound. Effectively, we reduce the insertion time of binary search trees from Θ(logn)\Theta(\log n) to O(min(log(n/Δi)+loglogΔi,  logq))O(\min(\log(n/|\Delta_i|) + \log \log |\Delta_i|, \; \log q)), where Δi\Delta_i is the gap in which the inserted element falls. Over a sequence of nn insertions and qq queries, a time bound of O(nlogq+qlogn)O(n \log q + q \log n) holds; better bounds are possible when queries are non-uniformly distributed. As an extreme case of non-uniformity, if all queries are for the minimum element, the lazy search tree performs as a priority queue with O(loglogn)O(\log \log n) time insert and decrease-key operations. The same data structure supports queries for any rank, interpolating between binary search trees and efficient priority queues. Lazy search trees can be implemented to operate mostly on arrays, requiring only O(min(q,n))O(\min(q, n)) pointers. Via direct reduction, our data structure also supports the efficient access theorems of the splay tree, providing a powerful data structure for non-uniform element access, both when the number of accesses is small and large.

Keywords

Cite

@article{arxiv.2010.08840,
  title  = {Lazy Search Trees},
  author = {Bryce Sandlund and Sebastian Wild},
  journal= {arXiv preprint arXiv:2010.08840},
  year   = {2020}
}

Comments

Accepted for publication in FOCS 2020

R2 v1 2026-06-23T19:25:23.534Z