Algorithmica

, Volume 72, Issue 4, pp 901–913 | Cite as

Linear-Space Data Structures for Range Minority Query in Arrays

  • Timothy M. Chan
  • Stephane Durocher
  • Matthew Skala
  • Bryan T. Wilkinson
Article

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.

Keywords

Data structures Range queries Minority Least frequent element 

Notes

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.

References

  1. 1.
    Bender, M.A., Farach-Colton, M.: The LCA problem revisited. In: Proceedings of LATIN, LNCS, vol. 1776, pp. 88–94. Springer, Berlin (2000)Google Scholar
  2. 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)Google Scholar
  3. 3.
    Brodal, G.S., Gfeller, B., Jørgensen, A.G., Sanders, P.: Towards optimal range medians. Theor. Comput. Sci. 412(24), 2588–2601 (2011)MATHCrossRefGoogle Scholar
  4. 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)Google Scholar
  5. 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)MathSciNetGoogle Scholar
  6. 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)Google Scholar
  7. 7.
    Chazelle, B.: Filtering search: a new approach to query-answering. SIAM J. Comput. 15(3), 703–724 (1986)MATHMathSciNetCrossRefGoogle Scholar
  8. 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)Google Scholar
  9. 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)MATHMathSciNetCrossRefGoogle Scholar
  10. 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)Google Scholar
  11. 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)Google Scholar
  12. 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)Google Scholar
  13. 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)Google Scholar
  14. 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)Google Scholar
  15. 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)Google Scholar
  16. 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)Google Scholar
  17. 17.
    Karpinski, M., Nekrich, Y.: Searching for frequent colors in rectangles. In: Proceedings of CCCG, pp. 11–14 (2008)Google Scholar
  18. 18.
    Krizanc, D., Morin, P., Smid, M.: Range mode and range median queries on lists and trees. Nordic J. Comput. 12, 1–17 (2005)MATHMathSciNetGoogle Scholar
  19. 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)Google Scholar
  20. 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)MATHMathSciNetCrossRefGoogle Scholar
  21. 21.
    Sadakane, K., Navarro, G.: Fully-functional succinct trees. In: Proceedings of ACM-SIAM SODA, pp. 134–149 (2010)Google Scholar

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  • Timothy M. Chan
    • 1
  • Stephane Durocher
    • 2
  • Matthew Skala
    • 2
  • Bryan T. Wilkinson
    • 3
  1. 1.Cheriton School of Computer ScienceUniversity of WaterlooWaterlooCanada
  2. 2.Department of Computer ScienceUniversity of ManitobaWinnipegCanada
  3. 3.Center for Massive Data Algorithmics (MADALGO)Aarhus UniversityÅrhusDenmark

Personalised recommendations