Skip to main content
Log in

Linear-Space Data Structures for Range Minority Query in Arrays

  • Published:
Algorithmica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3

Similar content being viewed by others

References

  1. Bender, M.A., Farach-Colton, M.: The LCA problem revisited. In: Proceedings of LATIN, LNCS, vol. 1776, pp. 88–94. Springer, Berlin (2000)

  2. 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)

  3. Brodal, G.S., Gfeller, B., Jørgensen, A.G., Sanders, P.: Towards optimal range medians. Theor. Comput. Sci. 412(24), 2588–2601 (2011)

    Article  MATH  Google Scholar 

  4. Chan, T.M.: Persistent predecessor search and orthogonal point location on the word RAM. In: Proceedings of ACM-SIAM SODA, pp. 1131–1145 (2011)

  5. 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)

    MathSciNet  Google Scholar 

  6. 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)

  7. Chazelle, B.: Filtering search: a new approach to query-answering. SIAM J. Comput. 15(3), 703–724 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  8. 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)

  9. Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making data structures persistent. J. Comput. Syst. Sci. 38(1), 86–124 (1989)

    Article  MATH  MathSciNet  Google Scholar 

  10. 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)

  11. 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)

  12. 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)

  13. 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)

  14. 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)

  15. 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)

  16. 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)

  17. Karpinski, M., Nekrich, Y.: Searching for frequent colors in rectangles. In: Proceedings of CCCG, pp. 11–14 (2008)

  18. Krizanc, D., Morin, P., Smid, M.: Range mode and range median queries on lists and trees. Nordic J. Comput. 12, 1–17 (2005)

    MATH  MathSciNet  Google Scholar 

  19. Petersen, H.: Improved bounds for range mode and range median queries. In: Proceedings of SOFSEM, LNCS, vol. 4910, pp. 418–423. Springer, Berlin (2008)

  20. Petersen, H., Grabowski, S.: Range mode and range median queries in constant time and sub-quadratic space. Inf. Proc. Lett. 109, 225–228 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  21. Sadakane, K., Navarro, G.: Fully-functional succinct trees. In: Proceedings of ACM-SIAM SODA, pp. 134–149 (2010)

Download references

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

Authors

Corresponding author

Correspondence to Stephane Durocher.

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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-014-9881-9

Keywords

Navigation