Abstract
We consider range queries that search for low-frequency elements (least frequent elements and \(\alpha \)-minorities) in arrays. An \(\alpha \)-minority of a query range has multiplicity no greater than an \(\alpha \) fraction of the elements in the range. Our data structure for the least frequent element range query problem requires \(O(n)\) space, \(O(n^{3/2})\) preprocessing time, and \(O(\sqrt{n})\) query time. A reduction from boolean matrix multiplication to this problem shows the hardness of simultaneous improvements in both preprocessing time and query time. Our data structure for the \(\alpha \)-minority range query problem requires \(O(n)\) space, supports queries in \(O(1/\alpha )\) time, and allows \(\alpha \) to be specified at query time.
Similar content being viewed by others
References
Bender, M.A., Farach-Colton, M.: The LCA problem revisited. In: Proceedings of LATIN, LNCS, vol. 1776, pp. 88–94. Springer, Berlin (2000)
Bose, P., Kranakis, E., Morin, P., Tang, Y.: Approximate range mode and range median queries. In: Proceedings of STACS, LNCS, vol. 3404, pp. 377–388. Springer, Berlin (2005)
Brodal, G.S., Gfeller, B., Jørgensen, A.G., Sanders, P.: Towards optimal range medians. Theor. Comput. Sci. 412(24), 2588–2601 (2011)
Chan, T.M.: Persistent predecessor search and orthogonal point location on the word RAM. In: Proceedings of ACM-SIAM SODA, pp. 1131–1145 (2011)
Chan, T.M., Durocher, S., Larsen, K.G., Morrison, J., Wilkinson, B.T.: Linear-space data structures for range mode query in arrays. Proc. STACS 14, 291–301 (2012)
Chan, T.M., Durocher, S., Skala, M., Wilkinson, B.T.: Linear-space data structures for range minority query in arrays. In: Proceedings of SWAT, LNCS, vol. 7357, pp. 295–306. Springer, Berlin (2012)
Chazelle, B.: Filtering search: a new approach to query-answering. SIAM J. Comput. 15(3), 703–724 (1986)
Demaine, E.D., Landau, G.M., Weimann, O.: On Cartesian trees and range minimum queries. In: Proceedings of ICALP, LNCS, vol. 5555, pp. 341–353. Springer, Berlin (2009)
Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making data structures persistent. J. Comput. Syst. Sci. 38(1), 86–124 (1989)
Durocher, S.: A simple linear-space data structure for constant-time range minimum query. In: Proceedings of Conference on Space Efficient Data Structures, Streams and Algorithms, LNCS, vol. 8066, pp. 48–60. Springer, Berlin (2013)
Durocher, S., He, M., Munro, J.I., Nicholson, P.K., Skala, M.: Range majority in constant time and linear space. In: Proceedings of ICALP, LNCS, vol. 6755, pp. 244–255. Springer, Berlin (2011)
Elmasry, A., He, M., Munro, J.I., Nicholson, P.: Dynamic range majority data structures. In: Proceedings of ISAAC, LNCS, vol. 7074, pp. 150–159. Springer, Berlin (2011)
Gagie, T., He, M., Munro, J.I., Nicholson, P.: Finding frequent elements in compressed 2D arrays and strings. In: Proceedings of SPIRE, LNCS, vol. 7024, pp. 295–300. Springer, Berlin (2011)
Gagie, T., Puglisi, S.J., Turpin, A.: Range quantile queries: another virtue of wavelet trees. In: Proceedings of SPIRE, LNCS, vol. 5721, pp. 1–6. Springer, Berlin (2009)
Greve, M., Jørgensen, A.G., Larsen, K.D., Truelsen, J.: Cell probe lower bounds and approximations for range mode. In: Proceedings of ICALP, LNCS, vol. 6198, pp. 605–616. Springer, Berlin (2010)
Jørgensen, A.G., Larsen, K.D.: Range selection and median: tight cell probe lower bounds and adaptive data structures. In: Proceedings of ACM-SIAM SODA, pp. 805–813 (2011)
Karpinski, M., Nekrich, Y.: Searching for frequent colors in rectangles. In: Proceedings of CCCG, pp. 11–14 (2008)
Krizanc, D., Morin, P., Smid, M.: Range mode and range median queries on lists and trees. Nordic J. Comput. 12, 1–17 (2005)
Petersen, H.: Improved bounds for range mode and range median queries. In: Proceedings of SOFSEM, LNCS, vol. 4910, pp. 418–423. Springer, Berlin (2008)
Petersen, H., Grabowski, S.: Range mode and range median queries in constant time and sub-quadratic space. Inf. Proc. Lett. 109, 225–228 (2009)
Sadakane, K., Navarro, G.: Fully-functional succinct trees. In: Proceedings of ACM-SIAM SODA, pp. 134–149 (2010)
Acknowledgments
The authors thank Patrick Nicholson for insightful discussion of the \(\alpha \)-majority range query problem as well as Kostas Tsakalidis for pointing out the alternative persistence approach to solving the distinct element searching problem. Also, the authors thank the reviewers for their suggestions that helped improve the text.
Author information
Authors and Affiliations
Corresponding author
Additional information
A preliminary version of these results appeared at the 13th Scandinavian Symposium and Workshops on Algorithm Theory (SWAT) [6].
Work supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC).
MADALGO is a Center of the Danish National Research Foundation.
Rights and permissions
About this article
Cite this article
Chan, T.M., Durocher, S., Skala, M. et al. Linear-Space Data Structures for Range Minority Query in Arrays. Algorithmica 72, 901–913 (2015). https://doi.org/10.1007/s00453-014-9881-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-014-9881-9