Predecessor Queries in Constant Time?

  • Marek Karpinski
  • Yakov Nekrich
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3669)


In this paper we design a new static data structure for batched predecessor queries. In particular, our data structure supports \(O(\sqrt{{\rm log}n})\) queries in O(1) time per query and requires \(O(n^{\epsilon\sqrt{{\rm log}n}})\) space for any ε > 0. This is the first o(N) space and O(1) amortized time data structure for arbitrary \(N = \Omega(n^{\epsilon\sqrt{{\rm log}n}})\) where N is the size of the universe. We also present a data structure that answers O(log log N) predecessor queries in O(1) time per query and requires \(O(n^{\epsilon{\rm log log} {\it N}})\) space for any ε > 0. The method of solution relies on a certain way of searching for predecessors of all elements of the query in parallel.

In a general case, our approach leads to a data structure that supports p(n) queries in \(O(\sqrt{{\rm log} n}/p(n))\) time per query and requires O(n \(^{p({\it n})}\)) space for any \(p(n) =O(\sqrt{{\rm log}n})\), and a data structure that supports p(N) queries in O(log log N/p(N)) time per query and requires O(n \(^{p({\it N})}\)) space for any p(N)=O(log log N).


Data Structure Hash Function Priority Queue Query Time Word Size 
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. [AL62]
    Adelson-Velskii, G.M., Landis, E.M.: An algorithm for the organization of information. Dokladi Akademii Nauk SSSR 146(2), 1259–1262 (1962)MathSciNetGoogle Scholar
  2. [AFK84]
    Ajtai, M., Fredman, M.L., Komlòs, J.: Hash Functions for Priority Queues. Information and Control 63(3), 217–225 (1984)zbMATHCrossRefMathSciNetGoogle Scholar
  3. [ABR01]
    Alstrup, S., Brodal, G.S., Rauhe, T.: Optimal static range reporting in one dimension. In: STOC 2001, pp. 476–482 (2001)Google Scholar
  4. [A95]
    Andersson, A.: Sublogarithmic Searching without Multiplications. In: FOCS 1995, pp. 655–663 (1995)Google Scholar
  5. [A96]
    Andersson, A.: Faster Deterministic Sorting and Searching in Linear Space. In: FOCS 1996, pp. 135–141 (1996)Google Scholar
  6. [AHNR95]
    Andersson, A., Hagerup, T., Nilsson, S., Raman, R.: Sorting in linear time? In: STOC 1995, pp. 427–436 (1995)Google Scholar
  7. [AT00]
    Andersson, A., Thorup, M.: Tight(er) worst-case bounds on dynamic searching and priority queues. In: STOC 2000, pp. 335–342 (2000)Google Scholar
  8. [AT02]
    Andersson, A., Thorup, M.: Dynamic Ordered Sets with Exponential Search Trees, The Computing Research Repository (CoRR), cs.DS/0210006: (2002), Available at
  9. [BF02]
    Beame, P., Fich, F.E.: Optimal Bounds for the Predecessor Problem and Related Problems. J. Comput. Syst. Sci. 65(1), 38–72 (2002)zbMATHCrossRefMathSciNetGoogle Scholar
  10. [BCKM01]
    Brodnik, A., Carlsson, S., Karlsson, J., Munro, J.I.: Worst case constant time priority queue. In: SODA 2001, pp. 523–528 (2001)Google Scholar
  11. [CW79]
    Carter, L., Wegman, M.N.: Universal Classes of Hash Functions. J. Comput. Syst. Sci. 18(2), 143–154 (1979)zbMATHCrossRefMathSciNetGoogle Scholar
  12. [E77]
    van Emde Boas, P.: Preserving Order in a Forest in Less Than Logarithmic Time and Linear Space. Inf. Process. Lett. 6(3), 80–82 (1977)zbMATHCrossRefGoogle Scholar
  13. [EKZ77]
    van Emde Boas, P., Kaas, R., Zijlstra, E.: Design and Implementation of an Efficient Priority Queue. Mathematical Systems Theory 10, 99–127 (1977)zbMATHCrossRefGoogle Scholar
  14. [FW94]
    Fredman, M.L., Willard, D.E.: Trans-Dichotomous Algorithms for Minimum Spanning Trees and Shortest Paths. J. Comput. Syst. Sci. 48(3), 533–551 (1994)zbMATHCrossRefMathSciNetGoogle Scholar
  15. [H98]
    Hagerup, T.: Sorting and Searching on the Word RAM. In: STACS 1998, pp. 366–398 (1998)Google Scholar
  16. [H02]
    Han, Y.: Deterministic sorting in O(n log log n) time and linear space. In: STOC 2002, pp. 602–608 (2002)Google Scholar
  17. [GL01]
    Gum, B., Lipton, R.: Cheaper by the Dozen: Batched Algorithms. In: 1st SIAM International Conference on Data Mining (2001), Available at
  18. [M84]
    Mehlhorn, K.: Data Structures and Algorithms 1: Sorting and Searching. Springer, Heidelberg (1984)zbMATHGoogle Scholar
  19. [PS80]
    Paul, W.J., Simon, S.: Decision Trees and Random Access Machines. In: International Symposium on Logik and Algorithmic, Zürich, pp. 331–340 (1980)Google Scholar
  20. [W83]
    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
  21. [W84]
    Willard, D.E.: New Trie Data Structures Which Support Very Fast Search Operations. J. Comput. Syst. Sci. 28(3), 379–394 (1984)zbMATHCrossRefMathSciNetGoogle Scholar
  22. [Y81]
    Yao, A.C.-C.: Should Tables Be Sorted? J. ACM 28(3), 615–628 (1981)zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Marek Karpinski
    • 1
  • Yakov Nekrich
    • 1
  1. 1.Dept. of Computer ScienceUniversity of Bonn 

Personalised recommendations