Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
4951302 | Journal of Discrete Algorithms | 2017 | 8 Pages |
Abstract
On a given vector X=ãx1,x2,â¦,xnã of integers, the range selection (i,j,k) query is finding the k-th smallest integer in ãxi,xi+1,â¦,xjã for any (i,j,k) such that 1â¤iâ¤jâ¤n, and 1â¤kâ¤jâi+1. Previous studies on the problem proposed data structures that occupied additional O(nâ
logâ¡n) bits of space over the X itself that answer the queries in logarithmic time. In this study, we replace X and encode all integers in it via a single wavelet tree by using S=nâ
logâ¡u+âlogâ¡xi+o(nâ
logâ¡u+âlogâ¡xi) bits, where u is the number of distinct âlogâ¡xiâ values observed in X. Notice that u is at most 32 (64) for 32-bit (64-bit) integers and when xi>u, the space used for xi in the proposed data structure is less than the Elias-δ coding of xi. Besides data-aware coding of X, the range selection is performed in O(logâ¡u+logâ¡xâ²) time where xâ² is the k-th smallest integer in the queried range. This result is adaptive and achieves the range selection regardless of the size of X, and the time-complexity depends on the answer itself. Additionally, we can answer range predecessor queries (i,j,xâ²): return the largest element yâ¤xâ² in ãxi,xi+1,â¦,xjã, in O(logâ¡u+logâ¡xâ²) time. In summary, to the best of our knowledge, we present the first algorithms using data-aware space and time for the general range selection and predecessor problems.
Related Topics
Physical Sciences and Engineering
Computer Science
Computational Theory and Mathematics
Authors
M. OÄuzhan Külekci, Sharma V. Thankachan,