par Hoffmann, Michael;Iacono, John
;Nicholson, Patrick;Raman, Rajeev
Référence Theoretical computer science, 710, page (97-115)
Publication Publié, 2018-02

Référence Theoretical computer science, 710, page (97-115)
Publication Publié, 2018-02
Article révisé par les pairs
Résumé : | In nearest larger value (NLV) problems, we are given an array of distinct numbers, and need to preprocess A to answer queries of the following form: given any index , return a “nearest” index j such that . We consider the variant where the values in A are distinct, and we wish to return an index j such that and is minimized, the nondirectional NLV (NNLV) problem. We consider NNLV in the encoding model, where the array A is deleted after preprocessing.The NNLV encoding problem turns out to have an unexpectedly rich structure: the effective entropy (optimal space usage) of the problem depends crucially on details in the definition of the problem. Of particular interest is the tiebreaking rule: if there exist two nearest indices such that and and , then which index should be returned? For the tiebreaking rule where the rightmost (i.e., largest) index is returned, we encode a path-compressed representation of the Cartesian tree that can answer all NNLV queries in bits, and can answer queries in time. An alternative approach, based on forbidden patterns, achieves a very similar space bound for two tiebreaking rules (including the one where ties are broken to the right), and (for a more flexible tiebreaking rule) achieves bits. Finally, we develop a fast method of counting distinguishable configurations for NNLV queries. Using this method, we prove a lower bound of bits of space for NNLV encodings for the tiebreaking rule where the rightmost index is returned. |