Engineering Predecessor Data Structures for Dynamic Integer Sets

Authors Patrick Dinklage , Johannes Fischer, Alexander Herlez

Thumbnail PDF


  • Filesize: 0.92 MB
  • 19 pages

Document Identifiers

Author Details

Patrick Dinklage
  • TU Dortmund University, Germany
Johannes Fischer
  • TU Dortmund University, Germany
Alexander Herlez
  • TU Dortmund University, Germany

Cite AsGet BibTex

Patrick Dinklage, Johannes Fischer, and Alexander Herlez. Engineering Predecessor Data Structures for Dynamic Integer Sets. In 19th International Symposium on Experimental Algorithms (SEA 2021). Leibniz International Proceedings in Informatics (LIPIcs), Volume 190, pp. 7:1-7:19, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2021)


We present highly optimized data structures for the dynamic predecessor problem, where the task is to maintain a set S of w-bit numbers under insertions, deletions, and predecessor queries (return the largest element in S no larger than a given key). The problem of finding predecessors can be viewed as a generalized form of the membership problem, or as a simple version of the nearest neighbour problem. It lies at the core of various real-world problems such as internet routing. In this work, we engineer (1) a simple implementation of the idea of universe reduction, similar to van-Emde-Boas trees (2) variants of y-fast tries [Willard, IPL'83], and (3) B-trees with different strategies for organizing the keys contained in the nodes, including an implementation of dynamic fusion nodes [Pǎtraşcu and Thorup, FOCS'14]. We implement our data structures for w = 32,40,64, which covers most typical scenarios. Our data structures finish workloads faster than previous approaches while being significantly more space-efficient, e.g., they clearly outperform standard implementations of the STL by finishing up to four times as fast using less than a third of the memory. Our tests also provide more general insights on data structure design, such as how small sets should be stored and handled and if and when new CPU instructions such as advanced vector extensions pay off.

Subject Classification

ACM Subject Classification
  • Theory of computation → Predecessor queries
  • integer data structures
  • dynamic data structures
  • predecessor
  • universe reduction
  • y-fast trie
  • fusion tree
  • B-tree


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


  1. Advanced Micro Devices Inc. AMD64 Architecture - Programmer’s Manual Volume 3: General-Purpose and System Instructions, September 2020. URL:
  2. Miklós Ajtai, Michael L. Fredman, and János Komlós. Hash functions for priority queues. Inf. Control., 63(3):217-225, 1984. URL:
  3. Arm Limited. A64 Instruction Set Reference, 2018. URL:
  4. Niklas Baumstark, Simon Gog, Tobias Heuer, and Julian Labeit. Practical range minimum queries revisited. In 16th International Symposium on Experimental Algorithms (SEA), pages 12:1-12:16. Dagstuhl, 2017. URL:
  5. Djamal Belazzougui. Predecessor search, string algorithms and data structures. In Encyclopedia of Algorithms, pages 1605-1611. Springer, 2016. URL:
  6. Pedro Celis, Per-Åke Larson, and J. Ian Munro. Robin hood hashing (preliminary report). In 26th Symposium on Foundations of Computer Science (FOCS), pages 281-288. IEEE, 1985. URL:
  7. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, 3rd Edition. MIT Press, 2009. Google Scholar
  8. Mikael Degermark, Andrej Brodnik, Svante Carlsson, and Stephen Pink. Small forwarding tables for fast routing lookups. In ACM SIGCOMM Conference on Applications, Technologies, Architectures, and Protocols for Computer Communication, pages 3-14. ACM, 1997. URL:
  9. Roman Dementiev, Lutz Kettner, Jens Mehnert, and Peter Sanders. Engineering a sorted list data structure for 32 bit key. In 6th Workshop on Algorithm Engineering and Experiments (ALENEX), pages 142-151. SIAM, 2004. URL:
  10. Patrick Dinklage, Johannes Fischer, Alexander Herlez, Tomasz Kociumaka, and Florian Kurpicz. Practical performance of space efficient data structures for longest common extensions. In 28th European Symposium on Algorithms (ESA), pages 39:1-39:20. Dagstuhl, 2020. URL:
  11. Héctor Ferrada and Gonzalo Navarro. Improved range minimum queries. J. Discrete Algorithms, 43:72-80, 2017. URL:
  12. E. Fredkin. Trie memory. Commun. ACM, 3:490-499, 1960. URL:
  13. Michael L. Fredman and Dan E. Willard. Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci., 47(3):424-436, 1993. URL:
  14. Steffen Heinz, Justin Zobel, and Hugh E. Williams. Burst tries: a fast, efficient data structure for string keys. ACM Trans. Inf. Syst., 20(2):192-223, 2002. URL:
  15. Lucian Ilie and Liviu Tinta. Practical algorithms for the longest common extension problem. In 16th International Symposium on String Processing and Information Retrieval (SPIRE), pages 302-309. Springer, 2009. URL:
  16. Intel Corporation. Intel (R) 64 and IA-32 Architectures - Software Developer’s Manual - Volume 2: Instruction Set Reference, A-Z, September 2016. URL:
  17. Maureen Korda and Rajeev Raman. An experimental evaluation of hybrid data structures for searching. In 3rd International Workshop on Algorithm Engineering (WAE), pages 214-228. Springer, 1999. URL:
  18. Kurt Maly. Compressed tries. Commun. ACM, 19(7):409-415, 1976. URL:
  19. Nicholas Nash and David Gregg. Comparing integer data structures for 32- and 64-bit keys. ACM J. Exp. Algorithmics, 15, 2010. URL:
  20. Gonzalo Navarro and Javiel Rojas-Ledesma. Predecessor search. ACM Comput. Surv., 53(5), 2020. URL:
  21. Mihai Pǎtraşcu and Mikkel Thorup. Time-space trade-offs for predecessor search. In 31st Annual ACM Symposium on Theory of Computing (STOC), pages 232-240. ACM, 2006. URL:
  22. Mihai Pǎtraşcu and Mikkel Thorup. Dynamic integer sets with optimal rank, select, and predecessor search. In 55th Symposium on Foundations of Computer Science (FOCS), pages 166-175. IEEE, 2014. URL:
  23. Robert Endre Tarjan and Andrew Chi-Chih Yao. Storing a sparse table. Commun. ACM, 22(11):606-611, 1979. URL:
  24. Peter van Emde Boas. Preserving order in a forest in less than logarithmic time. In 16th Symposium on Foundations of Computer Science (FOCS), pages 75-84. IEEE, 1975. URL:
  25. M. Wenzel. Wörterbücher für ein beschränktes Universum (dictionaries for a bounded universe). Master’s thesis, Saarland University, Germany, 1992. Google Scholar
  26. Dan E. Willard. Log-logarithmic worst-case range queries are possible in space theta(n). Inform. Process. Lett., 17(2):81-84, 1983. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail