Practical Implementation of Encoding Range Top-2 Queries
- 10 September 2022
- journal article
- research article
- Published by Oxford University Press (OUP) in The Computer Journal
- Vol. 66 (11), 2794-2809
- https://doi.org/10.1093/comjnl/bxac122
Abstract
We design a practical variant of an encoding for range Top-2 query (RT2Q) and evaluate its performance. Given an array |$A[1,n]$| of |$n$| elements from a total order, the range Top-2 encoding problem is to construct a data structure that answers |${\textsf{RT2Q}}{}$|, which returns the positions of the first and second largest elements within a given range of |$A$|, without accessing the array |$A$| at query time. We design the following two implementations: (i) an implementation based on an alternative representation of Davoodi et al.’s [Phil. Trans. Royal Soc. A, 2016] data structure, which supports queries efficiently. Experimental results show that our implementation is efficient in practice and gives improved time-space trade-offs compared with the indexing data structures (which keep the original array |$A$| as part of the data structure) for range maximum queries. (ii) Another implementation based on Jo et al.’s |${\textsf{RT2Q}}{}$| encoding on |$2 \times n$| array [CPM, 2016], which can be constructed in |$O(n)$| time. We compare our encoding with Gawrychowski and Nicholson’s optimal encoding [ICALP, 2015] and show that in most cases, our encoding shows faster construction time while using a competitive space in practice.Keywords
Funding Information
- National Research Foundation of Korea (NRF-2020R1G1A1101477)
This publication has 18 references indexed in Scilit:
- A Uniform Paradigm to Succinctly Encode Various Families of TreesAlgorithmica, 2012
- Ultra-succinct representation of ordered trees with applicationsJournal of Computer and System Sciences, 2012
- Space-Efficient Preprocessing Schemes for Range Minimum Queries on Static ArraysSIAM Journal on Computing, 2011
- A survey of top- k query processing techniques in relational database systemsACM Computing Surveys, 2008
- Succinct indexable dictionaries with applications to encoding k -ary trees, prefix sums and multisetsACM Transactions on Algorithms, 2007
- Compressed Suffix Trees with Full FunctionalityTheory of Computing Systems, 2007
- Representing Trees of Higher DegreeAlgorithmica, 2005
- Space Efficient Suffix TreesJournal of Algorithms, 2001
- On random cartesian treesRandom Structures & Algorithms, 1994
- A unifying look at data structuresCommunications of the ACM, 1980