Faster Dynamic Range Mode

Authors Bryce Sandlund, Yinzhan Xu

Thumbnail PDF


  • Filesize: 0.5 MB
  • 14 pages

Document Identifiers

Author Details

Bryce Sandlund
  • Cheriton School of Computer Science, University of Waterloo, Canada
Yinzhan Xu
  • CSAIL, Massachusetts Institute of Technology, Cambridge, MA, USA


We would like to thank Virginia Vassilevska Williams for her valuable comments on a draft of this paper. We would like to thank the anonymous reviewers for their helpful suggestions.

Cite AsGet BibTex

Bryce Sandlund and Yinzhan Xu. Faster Dynamic Range Mode. In 47th International Colloquium on Automata, Languages, and Programming (ICALP 2020). Leibniz International Proceedings in Informatics (LIPIcs), Volume 168, pp. 94:1-94:14, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2020)


In the dynamic range mode problem, we are given a sequence a of length bounded by N and asked to support element insertion, deletion, and queries for the most frequent element of a contiguous subsequence of a. In this work, we devise a deterministic data structure that handles each operation in worst-case Õ(N^0.655994) time, thus breaking the O(N^{2/3}) per-operation time barrier for this problem. The data structure is achieved by combining the ideas in Williams and Xu (SODA 2020) for batch range mode with a novel data structure variant of the Min-Plus product.

Subject Classification

ACM Subject Classification
  • Theory of computation → Data structures design and analysis
  • Range Mode
  • Min-Plus Product


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Noga Alon, Zvi Galil, and Oded Margalit. On the exponent of the all pairs shortest path problem. J. Comput. Syst. Sci., 54(2):255-262, 1997. Google Scholar
  2. Prosenjit Bose, Evangelos Kranakis, Pat Morin, and Yihui Tang. Approximate range mode and range median queries. In Annual Symposium on Theoretical Aspects of Computer Science, 2005. Google Scholar
  3. Karl Bringmann, Fabrizio Grandoni, Barna Saha, and Virginia Williams. Truly sub-cubic algorithms for language edit distance and rna folding via fast bounded-difference min-plus product. SIAM Journal on Computing, 48, July 2017. URL:
  4. Gerth Stølting Brodal, Beat Gfeller, Allan Jørgensen, and Peter Sanders. Towards optimal range medians. In Theoretical Computer Science, 2011. Google Scholar
  5. Timothy M. Chan. More algorithms for all-pairs shortest paths in weighted graphs. SIAM J. Comput., 39(5):2075-2089, 2010. Google Scholar
  6. Timothy M. Chan, Stephane Durocher, Kasper Green Larsen, Jason Morrison, and Bryan T. Wilkinson. Linear-space data structures for range mode query in arrays. Theory of Computing Systems, 55:719-741, 2014. Google Scholar
  7. Timothy M Chan and Konstantinos Tsakalidis. Dynamic orthogonal range searching on the ram, revisited. In LIPIcs-Leibniz International Proceedings in Informatics, volume 77. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2017. Google Scholar
  8. Hicham El-Zein, Meng He, J. Ian Munro, Yakov Nekrich, and Bryce Sandlund. On approximate range mode and range selection. In 30th International Symposium on Algorithms and Computation (ISAAC 2019), 2019. Google Scholar
  9. Hicham El-Zein, Meng He, J. Ian Munro, and Bryce Sandlund. Improved time and space bounds for dynamic range mode. In Proceedings of the 26th Annual European Symposium on Algorithms, pages 25:1-25:13, 2018. Google Scholar
  10. Amr Elmasry, Meng He, J Ian Munro, and Patrick K Nicholson. Dynamic range majority data structures. In International Symposium on Algorithms and Computation, pages 150-159. Springer, 2011. Google Scholar
  11. Michael J Fischer and Albert R Meyer. Boolean matrix multiplication and transitive closure. In n 12th Annual Symposium on Switching and Automata Theory, pages 129-131. IEEE, 1971. Google Scholar
  12. Travis Gagie, Meng He, and Gonzalo Navarro. Compressed dynamic range majority data structures. In Data Compression Conference (DCC), 2017, pages 260-269. IEEE, 2017. Google Scholar
  13. François Le Gall. Powers of tensors and fast matrix multiplication. In International Symposium on Symbolic and Algebraic Computation, ISSAC 2014, Kobe, Japan, July 23-25, 2014, pages 296-303, 2014. Google Scholar
  14. François Le Gall and Florent Urrutia. Improved rectangular matrix multiplication using powers of the coppersmith-winograd tensor. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1029-1046. SIAM, 2018. Google Scholar
  15. Mark Greve, Allan Grønlund Jørgensen, Kasper Dalgaard Larsen, and Jakob Truelsen. Cell probe lower bounds and approximations for range mode. In International Colloquium on Automata, Languages, and Programming, 2010. Google Scholar
  16. Meng He, J. Ian Munro, and Patrick K. Nicholson. Dynamic range selection in linear space. In International Symposium on Algorithms and Computation, 2011. Google Scholar
  17. Monika Henzinger, Sebastian Krinninger, Danupon Nanongkai, and Thatchaphol Saranurak. Unifying and strengthening hardness for dynamic problems via the online matrix-vector multiplication conjecture. In Proceedings of the Forty-Seventh Annual ACM Symposium on Theory of Computing, page 21–30, 2015. Google Scholar
  18. Danny Krizanc, Pat Morin, and Michiel Smid. Range mode and range median queries on lists and trees. Nordic Journal of Computing, 2005. Google Scholar
  19. François Le Gall. Faster algorithms for rectangular matrix multiplication. In 2012 IEEE 53rd annual symposium on foundations of computer science, pages 514-523. IEEE, 2012. Google Scholar
  20. Grazia Lotti and Francesco Romani. On the asymptotic complexity of rectangular matrix multiplication. Theoretical Computer Science, 23(2):171-185, 1983. Google Scholar
  21. Mark H Overmars. The design of dynamic data structures, volume 156. Springer Science & Business Media, 1983. Google Scholar
  22. Mihai Pătraşcu and Emanuele Viola. Cell-probe lower bounds for succinct partial sums. In Proceedings of the twenty-first annual ACM-SIAM symposium on Discrete Algorithms, pages 117-122. Society for Industrial and Applied Mathematics, 2010. Google Scholar
  23. Raimund Seidel. On the all-pairs-shortest-path problem in unweighted undirected graphs. J. Comput. Syst. Sci., 51(3):400-403, 1995. Google Scholar
  24. Avi Shoshan and Uri Zwick. All pairs shortest paths in undirected graphs with integer weights. In 40th Annual IEEE Symposium on Foundations of Computer Science, pages 605-615, 1999. Google Scholar
  25. Virginia Vassilevska Williams. Multiplying matrices faster than Coppersmith-Winograd. In Proceedings of the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY, USA, May 19 - 22, 2012, pages 887-898, 2012. Google Scholar
  26. Virginia Vassilevska Williams and Yinzhan Xu. Truly subcubic min-plus product for less structured matrices, with applications. In Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, 2020. Google Scholar
  27. Raphael Yuster. Efficient algorithms on sets of permutations, dominance, and real-weighted apsp. In 20th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 950-957, 2009. Google Scholar
  28. Uri Zwick. All pairs shortest paths using bridging sets and rectangular matrix multiplication. J. ACM, 49(3):289-317, 2002. Google Scholar