186 research outputs found

    Asymptotically Optimal Encodings of Range Data Structures for Selection and Top-k Queries

    Get PDF
    Given an array A[1, n] of elements with a total order, we consider the problem of building a data structure that solves two queries: (a) selection queries receive a range [i, j] and an integer k and return the position of the kth largest element in A[i, j]; (b) top-k queries receive [i, j] and k and return the positions of the k largest elements in A[i, j]. These problems can be solved in optimal time, O(1 + lg k/ lg lg n) and O(k), respectively, using linear-space data structures. We provide the first study of the encoding data structures for the above problems, where A cannot be accessed at query time. Several applications are interested in the relative order of the entries of A, and their positions, rather their actual values, and thus we do not need to keep A at query time. In those cases, encodings save storage space: we first show that any encoding answering such queries requires n lg k − O(n + k lg k) bits of space; then, we design encodings using O(n lg k) bits, that is, asymptotically optimal up to constant factors, while preserving optimal query time.Peer-reviewedPost-prin

    Optimal Encodings for Range Min-Max and Top-k

    No full text
    In this paper we consider various encoding problems for range queries on arrays. In these problems, the goal is that the encoding occupies the information theoretic minimum space required to answer a particular set of range queries. Given an array A[1..n]A[1..n] a range top-kk query on an arbitrary range [i,j]⊆[1,n][i,j] \subseteq [1,n] asks us to return the ordered set of indices {l1,...,lk}\{l_1 ,...,l_k \} such that A[lm]A[l_m] is the mm-th largest element in A[i..j]A[i..j]. We present optimal encodings for range top-kk queries, as well as for a new problem which we call range min-max, in which the goal is to return the indices of both the minimum and maximum element in a range
    • …
    corecore