A Catalogue of Algorithms for Building Weak Heaps

  • Stefan Edelkamp
  • Amr Elmasry
  • Jyrki Katajainen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7643)


An array-based weak heap is an efficient data structure for realizing an elementary priority queue. In this paper we focus on the construction of a weak heap. Starting from a straightforward algorithm, we end up with a catalogue of algorithms that optimize the standard algorithm in different ways. As the optimization criteria, we consider how to reduce the number of instructions, branch mispredictions, cache misses, and element moves. We also consider other approaches for building a weak heap: one based on repeated insertions and another relying on a non-standard memory layout. For most of the algorithms considered, we also study their effectiveness in practice.


Execution Time Priority Queue Element Move Left Child Element Comparison 
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.
    Bojesen, J., Katajainen, J., Spork, M.: Performance engineering case study: Heap construction. ACM J. Exp. Algorithmics 5, Article 15 (2000)Google Scholar
  2. 2.
    Bruun, A., Edelkamp, S., Katajainen, J., Rasmussen, J.: Policy-Based Benchmarking of Weak Heaps and Their Relatives. In: Festa, P. (ed.) SEA 2010. LNCS, vol. 6049, pp. 424–435. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  3. 3.
    Dutton, R.D.: Weak-heap sort. BIT 33(3), 372–381 (1993)MathSciNetCrossRefGoogle Scholar
  4. 4.
    Edelkamp, S., Elmasry, A., Katajainen, J.: The weak-heap data structure: Variants and applications. J. Discrete Algorithms 16, 187–205 (2012)MathSciNetCrossRefGoogle Scholar
  5. 5.
    Edelkamp, S., Wegener, I.: On the Performance of WEAK − HEAPSORT. In: Reichel, H., Tison, S. (eds.) STACS 2000. LNCS, vol. 1770, pp. 254–266. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  6. 6.
    Floyd, R.W.: Algorithm 245: Treesort 3. Commun. ACM 7(12), 701 (1964)CrossRefGoogle Scholar
  7. 7.
    Vuillemin, J.: A data structure for manipulating priority queues. Commun. ACM 21(4), 309–315 (1978)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Wegener, I.: Bottom-up-heapsort, a new variant of heapsort beating, on an average, quicksort (if n is not very small). Theoret. Comput. Sci. 118(1), 81–98 (1993)MathSciNetzbMATHCrossRefGoogle Scholar
  9. 9.
    Williams, J.W.J.: Algorithm 232: Heapsort. Commun. ACM 7(6), 347–348 (1964)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Stefan Edelkamp
    • 1
  • Amr Elmasry
    • 2
    • 3
  • Jyrki Katajainen
    • 2
  1. 1.Faculty 3—Mathematics and Computer ScienceUniversity of BremenBremenGermany
  2. 2.Department of Computer ScienceUniversity of CopenhagenCopenhagen EastDenmark
  3. 3.Computer and Systems Engineering DepartmentAlexandria UniversityAlexandriaEgypt

Personalised recommendations