Cell Probe Lower Bounds and Approximations for Range Mode

  • Mark Greve
  • Allan Grønlund Jørgensen
  • Kasper Dalgaard Larsen
  • Jakob Truelsen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6198)


The mode of a multiset of labels, is a label that occurs at least as often as any other label. The input to the range mode problem is an array A of size n. A range query [i,j] must return the mode of the subarray A[i],A[i + 1],...,A[j]. We prove that any data structure that uses S memory cells of w bits needs \(\Omega(\frac{{\rm log} n}{\log (Sw/n)})\) time to answer a range mode query. Secondly, we consider the related range k-frequency problem. The input to this problem is an array A of size n, and a query [i,j] must return whether there exists a label that occurs precisely k times in the subarray A[i],A[i + 1],...,A[j]. We show that for any constant k > 1, this problem is equivalent to 2D orthogonal rectangle stabbing, and that for k = 1 this is no harder than four-sided 3D orthogonal range emptiness. Finally, we consider approximate range mode queries. A c-approximate range mode query must return a label that occurs at least 1/c times that of the mode. We describe a linear space data structure that supports 3-approximate range mode queries in constant time, and a data structure that uses \(O(\frac{n}{\varepsilon})\) space and supports (1 + ε)-approximation queries in \(O({\rm log} {\frac {1}{\varepsilon}})\) time.


Data Structure Range Query Query Time Range Mode Answer Query 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Yao, A.C.C.: Should tables be sorted? J. ACM 28(3), 615–628 (1981)zbMATHCrossRefGoogle Scholar
  2. 2.
    Krizanc, D., Morin, P., Smid, M.H.M.: Range mode and range median queries on lists and trees. Nord. J. Comput. 12(1), 1–17 (2005)zbMATHMathSciNetGoogle Scholar
  3. 3.
    Petersen, H.: Improved bounds for range mode and range median queries. In: Geffert, V., Karhumäki, J., Bertoni, A., Preneel, B., Návrat, P., Bieliková, M. (eds.) SOFSEM 2008. LNCS, vol. 4910, pp. 418–423. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  4. 4.
    Petersen, H., Grabowski, S.: Range mode and range median queries in constant time and sub-quadratic space. Inf. Process. Lett. 109(4), 225–228 (2008)CrossRefMathSciNetGoogle Scholar
  5. 5.
    Bose, P., Kranakis, E., Morin, P., Tang, Y.: Approximate range mode and range median queries. In: Proc. 22nd Symposium on Theoretical Aspects of Computer Science, pp. 377–388 (2005)Google Scholar
  6. 6.
    Patrascu, M., Thorup, M.: Higher lower bounds for near-neighbor and further rich problems. In: Proc. of the 47th Annual IEEE Symposium on Foundations of Computer Science, pp. 646–654 (2006)Google Scholar
  7. 7.
    Pǎtraşcu, M.: (Data) structures. In: Proc. 49th Annual IEEE Symposium on Foundations of Computer Science, pp. 434–443 (2008)Google Scholar
  8. 8.
    Pǎtraşcu, M.: Lower bounds for 2-dimensional range counting. In: Proc. 39th ACM Symposium on Theory of Computing, pp. 40–46 (2007)Google Scholar
  9. 9.
    JáJá, J., Mortensen, C.W., Shi, Q.: Space-efficient and fast algorithms for multidimensional dominance reporting and counting. In: Fleischer, R., Trippen, G. (eds.) ISAAC 2004. LNCS, vol. 3341, pp. 558–568. Springer, Heidelberg (2004)Google Scholar
  10. 10.
    Afshani, P.: On dominance reporting in 3D. In: Proc. of the 16th Annual European Symposium on Algorithms, pp. 41–51 (2008)Google Scholar
  11. 11.
    Willard, D.E.: Log-logarithmic worst-case range queries are possible in space theta(n). Inf. Process. Lett. 17(2), 81–84 (1983)zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Miltersen, P.B., Nisan, N., Safra, S., Wigderson, A.: On data structures and asymmetric communication complexity. J. Comput. Syst. Sci. 57(1), 37–49 (1998)zbMATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13(2), 338–355 (1984)zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making data structures persistent. Journal of Computer and System Sciences 38(1), 86–124 (1989)zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Jacobson, G.J.: Succinct static data structures. PhD thesis, Carnegie Mellon University, Pittsburgh, PA, USA (1988)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Mark Greve
    • 1
  • Allan Grønlund Jørgensen
    • 1
  • Kasper Dalgaard Larsen
    • 1
  • Jakob Truelsen
    • 1
  1. 1.MADALGO, Department of Computer ScienceAarhus UniversityDenmark

Personalised recommendations