Abstract

We present \(O(n)\)-space data structures to support various range frequency queries on a given array \(A[0:n-1]\) or tree \(T\) with \(n\) nodes. Given a query consisting of an arbitrary pair of pre-order rank indices \((i,j)\), our data structures return a least frequent element, mode, \(\alpha \)-minority, or top-\(k\) colors (values) of the multiset of elements in the unique path with endpoints at indices \(i\) and \(j\) in \(A\) or \(T\). We describe a data structure that supports range least frequent element queries on arrays in \(O(\sqrt{n / w})\) time, improving the \({\varTheta }(\sqrt{n})\) worst-case time required by the data structure of Chan et al. (SWAT 2012), where \(w \in {\varOmega }(\log n)\) is the word size in bits. We describe a data structure that supports path mode queries on trees in \(O(\log \log n \sqrt{n / w})\) time, improving the \({\varTheta }(\sqrt{n} \log n)\) worst-case time required by the data structure of Krizanc et al. (ISAAC 2003). We describe the first data structures to support path least frequent element queries, path \(\alpha \)-minority queries, and path top-\(k\) color queries on trees in \(O(\log \log n \sqrt{n/w}),\,O(\alpha ^{-1} \log \log n)\), and \(O(k)\) time, respectively, where \(\alpha \in [0,1]\) and \(k \in \{1,\ldots , n\}\) are specified at query time.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.