Combined Data Structure for Previous- and Next-Smaller-Values
Data Structures and Algorithms
2011-02-03 v1
Abstract
Let be a static array storing elements from a totally ordered set. We present a data structure of optimal size at most bits that allows us to answer the following queries on in constant time, without accessing : (1) previous smaller value queries, where given an index , we wish to find the first index to the left of where is strictly smaller than at , and (2) next smaller value queries, which search to the right of . As an additional bonus, our data structure also allows to answer a third kind of query: given indices , find the position of the minimum in . Our data structure has direct consequences for the space-efficient storage of suffix trees.
Cite
@article{arxiv.1102.0395,
title = {Combined Data Structure for Previous- and Next-Smaller-Values},
author = {Johannes Fischer},
journal= {arXiv preprint arXiv:1102.0395},
year = {2011}
}
Comments
to appear in Theoretical Computer Science