encyclopegia.org

Heapsort

In computer science, heapsort is an efficient, comparison-based sorting algorithm that reorganizes an input array into a heap (a data structure where each node is greater than its children) and then repeatedly removes the largest node from that heap, placing it at the end of the array in a similar manner to Selection sort. Although somewhat slower in practice on most machines than a well-implemented quicksort, it has the advantages of very simple implementation and a more favorable worst-case runtime. Most real-world quicksort variants include an implementation of heapsort as a fallback should they detect that quicksort is becoming degenerate. Heapsort is an in-place algorithm, but it is not a stable sort. Heapsort was invented by J. W. J. Williams in 1964. The paper also introduced the binary heap as a useful data structure in its own right. In the same year, Robert W. Floyd published an improved version that could sort an array in-place, continuing his earlier research into the treesort algorithm.

In computer science, heapsort is an efficient, comparison-based sorting algorithm that reorganizes an input array into a heap (a data structure where each node is greater than its children) and then repeatedly removes the largest node from that heap, placing it at the end of the array in a similar manner to Selection sort. Although somewhat slower in practice on most machines than a well-implemented quicksort, it has the advantages of very simple implementation and a more favorable worst-case runtime. Most real-world quicksort variants include an implementation of heapsort as a fallback should they detect that quicksort is becoming degenerate. Heapsort is an in-place algorithm, but it is not a stable sort. Heapsort was invented by J. W. J. Williams in 1964. The paper also introduced the binary heap as a useful data structure in its own right. In the same year, Robert W. Floyd published an improved version that could sort an array in-place, continuing his earlier research into the treesort algorithm. iLeftChild(i) = 2⋅i + 1 iRightChild(i) = 2⋅i + 2 iParent(i) = floor((i−1) / 2) where the floor function rounds down to the preceding integer. For a more detailed explanation, see . This binary tree is a max-heap when each node is greater than or equal to both of its children. Equivalently, each node is less than or equal to its parent. This rule, applied throughout the tree, results in the maximum node being located at the root of the tree. In the first phase, a heap is built out of the data (see ). In the second phase, the heap is converted to a sorted array by repeatedly removing the largest element from the heap (the root of the heap), and placing it at the start of the sorted array. The heap is updated after each removal to maintain the heap property. Once all objects have been removed from the heap, the result is a sorted array. Heapsort is normally performed in place. During the first phase, the array is divided into an unsorted prefix and a heap-ordered suffix (initially empty). Each step shrinks the prefix and expands the suffix. When the prefix is empty, this phase is complete. During the second phase, the array is divided into a heap-ordered prefix and a sorted suffix (initially empty). Each step shrinks the prefix and expands the suffix. When the prefix is empty, the array is sorted. parent := iParent(end) if a[parent] 2 = 9 elements, doing more work with six comparisons than three levels in the binary heap, which only cover 2 3 = 8. This is primarily of academic interest, or as a student exercise, as the additional complexity is not worth the minor savings, and bottom-up heapsort beats both. Memory-optimized heapsort improves heapsort's locality of reference by increasing the number of children even more. This increases the number of comparisons, but because all children are stored consecutively in memory, reduces the number of cache lines accessed during heap traversal, a net performance improvement. The standard implementation of Floyd's heap-construction algorithm causes a large number of cache misses once the size of the data exceeds that of the CPU cache. Better performance on large data sets can be obtained by merging in depth-first order, combining subheaps as soon as possible, rather than combining all subheaps on one level before proceeding to the one above. Out-of-place heapsort improves on bottom-up heapsort by eliminating the worst case, guaranteeing comparisons. When the maximum is taken, rather than fill the vacated space with an unsorted data value, fill it with a sentinel value, which never "bounces" back up. It turns out that this can be used as a primitive in an in-place (and non-recursive) "QuickHeapsort" algorithm. First, you perform a quicksort-like partitioning pass, but reversing the order of the partitioned data in the array. Suppose (without loss of generality) that the smaller partition is the one greater than the pivot, which should go at the end of the array, but our reversed partitioning step places it at the beginning. Form a heap out of the smaller partition and do out-of-place heapsort on it, exchanging the extracted maxima with values from the end of the array. These are less than the pivot, meaning less than any value in the heap, so serve as sentinel values. Once the heapsort is complete (and the pivot moved to just before the now-sorted end of the array), the order of the partitions has been reversed, and the larger partition at the beginning of the array may be sorted in the same way. (Because there is no non-tail recursion, this also eliminates quicksort's stack usage.) The smoothsort algorithm is a variation of heapsort developed by Edsger W. Dijkstra in 1981. Like heapsort, smoothsort's upper bound is . The advantage of smoothsort is that it comes closer to time if the input is already sorted to some degree, whereas heapsort averages regardless of the initial sorted state. Due to its complexity, smoothsort is rarely used. Levcopoulos and Petersson describe a variation of heapsort based on a heap of Cartesian trees. First, a Cartesian tree is built from the input in time, and its root is placed in a 1-element binary heap. Then we repeatedly extract the minimum from the binary heap, output the tree's root element, and add its left and right children (if any) which are themselves Cartesian trees, to the binary heap. As they show, if the input is already nearly sorted, the Cartesian trees will be very unbalanced, with few nodes having left and right children, resulting in the binary heap remaining small, and allowing the algorithm to sort more quickly than for inputs that are already nearly sorted. Several variants such as weak heapsort require comparisons in the worst case, close to the theoretical minimum, using one extra bit of state per node. While this extra bit makes the algorithms not truly in-place, if space for it can be found inside the element, these algorithms are simple and efficient, but still slower than binary heaps if key comparisons are cheap enough (e.g. integer keys) that a constant factor does not matter. Katajainen's "ultimate heapsort" requires no extra storage, performs comparisons, and a similar number of element moves. It is, however, even more complex and not justified unless comparisons are very expensive.

References

  1. On the Best Case of Heapsort · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "On the Best Case of Heapsort." Bollobás, B. 2026-11-21. https://www.math.cmu.edu/~af1p/Texfiles/Best.pdf. Accessed 24 November 2026.

    Chicago "On the Best Case of Heapsort." Bollobás, B. 2026-11-21. https://www.math.cmu.edu/~af1p/Texfiles/Best.pdf.

    APA Bollobás, B. (2026). On the Best Case of Heapsort. Retrieved November 24, 2026, from https://www.math.cmu.edu/~af1p/Texfiles/Best.pdf

  2. Knuth, Donald E. (1973). Sorting and Searching . The Art of Computer Programming . Vol. 3 (1st ed.). Reading, MA: Addison-Wesley Professional. Ex. 18, p. 158, § 5.2.3. ISBN 0-201-03803-X . Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Knuth, Donald E. (1973). Sorting and Searching . The Art of Computer Programming . Vol. 3 (1st ed.). Reading, MA: Addison-Wesley Professional. Ex. 18, p. 158, § 5.2.3. ISBN 0-201-03803-X . Wikipedia revision 1373708813, retrieved 2026-11-22." Knuth, Donald E. 2026-11-21. https://en.wikipedia.org/wiki/Donald_Knuth. Accessed 24 November 2026.

    Chicago "Knuth, Donald E. (1973). Sorting and Searching . The Art of Computer Programming . Vol. 3 (1st ed.). Reading, MA: Addison-Wesley Professional. Ex. 18, p. 158, § 5.2.3. ISBN 0-201-03803-X . Wikipedia revision 1373708813, retrieved 2026-11-22." Knuth, Donald E. 2026-11-21. https://en.wikipedia.org/wiki/Donald_Knuth.

    APA Knuth, Donald E. (2026). Knuth, Donald E. (1973). Sorting and Searching . The Art of Computer Programming . Vol. 3 (1st ed.). Reading, MA: Addison-Wesley Professional. Ex. 18, p. 158, § 5.2.3. ISBN 0-201-03803-X . Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Donald_Knuth

  3. 8.6 Heapsort · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "8.6 Heapsort." Moret, Bernard ; Shapiro, Henry D. 2026-11-21. https://en.wikipedia.org/wiki/Bernard_Moret. Accessed 24 November 2026.

    Chicago "8.6 Heapsort." Moret, Bernard ; Shapiro, Henry D. 2026-11-21. https://en.wikipedia.org/wiki/Bernard_Moret.

    APA Moret, Bernard ; Shapiro, Henry D. (2026). 8.6 Heapsort. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Bernard_Moret

  4. The worst-case complexity of McDiarmid and Reed's variant of Bottom-Up Heapsort is less than n log n + 1.1 n · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "The worst-case complexity of McDiarmid and Reed's variant of Bottom-Up Heapsort is less than n log n + 1.1 n." Wegener, Ingo (March 1992). 2026-11-21. https://en.wikipedia.org/wiki/Ingo_Wegener. Accessed 24 November 2026.

    Chicago "The worst-case complexity of McDiarmid and Reed's variant of Bottom-Up Heapsort is less than n log n + 1.1 n." Wegener, Ingo (March 1992). 2026-11-21. https://en.wikipedia.org/wiki/Ingo_Wegener.

    APA Wegener, Ingo (March 1992). (2026). The worst-case complexity of McDiarmid and Reed's variant of Bottom-Up Heapsort is less than n log n + 1.1 n. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Ingo_Wegener

  5. Chapter 8: Sorting · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Chapter 8: Sorting." Tenenbaum, Aaron M. 2026-11-21. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.

    Chicago "Chapter 8: Sorting." Tenenbaum, Aaron M. 2026-11-21. https://en.wikipedia.org/wiki/ISBN_(identifier).

    APA Tenenbaum, Aaron M. (2026). Chapter 8: Sorting. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)

  6. Sedgewick, Robert ; Schaffer, Russel W. (October 1990). The Best Case of Heapsort (Technical report). Princeton University. TR-293-90. Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Sedgewick, Robert ; Schaffer, Russel W. (October 1990). The Best Case of Heapsort (Technical report). Princeton University. TR-293-90. Wikipedia revision 1373708813, retrieved 2026-11-22." Sedgewick, Robert ; Schaffer, Russel W. 2026-11-21. https://en.wikipedia.org/wiki/Robert_Sedgewick_(computer_scientist). Accessed 24 November 2026.

    Chicago "Sedgewick, Robert ; Schaffer, Russel W. (October 1990). The Best Case of Heapsort (Technical report). Princeton University. TR-293-90. Wikipedia revision 1373708813, retrieved 2026-11-22." Sedgewick, Robert ; Schaffer, Russel W. 2026-11-21. https://en.wikipedia.org/wiki/Robert_Sedgewick_(computer_scientist).

    APA Sedgewick, Robert ; Schaffer, Russel W. (2026). Sedgewick, Robert ; Schaffer, Russel W. (October 1990). The Best Case of Heapsort (Technical report). Princeton University. TR-293-90. Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Robert_Sedgewick_(computer_scientist)

  7. In-place Heap Construction with Optimized Comparisons, Moves, and Cache Misses · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "In-place Heap Construction with Optimized Comparisons, Moves, and Cache Misses." Chen, Jingsen; Edelkamp, Stefan; Elmasry, Amr; Katajainen, Jyrki (27–31 August 2012). 2026-11-21. https://web.archive.org/web/20161229031307/https://pdfs.semanticscholar.org/9cc6/36d7998d58b3937ba0098e971710ff039612.pdf. Accessed 24 November 2026.

    Chicago "In-place Heap Construction with Optimized Comparisons, Moves, and Cache Misses." Chen, Jingsen; Edelkamp, Stefan; Elmasry, Amr; Katajainen, Jyrki (27–31 August 2012). 2026-11-21. https://web.archive.org/web/20161229031307/https://pdfs.semanticscholar.org/9cc6/36d7998d58b3937ba0098e971710ff039612.pdf.

    APA Chen, Jingsen; Edelkamp, Stefan; Elmasry, Amr; Katajainen, Jyrki (27–31 August 2012). (2026). In-place Heap Construction with Optimized Comparisons, Moves, and Cache Misses. Retrieved November 24, 2026, from https://web.archive.org/web/20161229031307/https://pdfs.semanticscholar.org/9cc6/36d7998d58b3937ba0098e971710ff039612.pdf

  8. Cantone, Domenico; Concotti, Gianluca (1–3 March 2000). QuickHeapsort, an efficient mix of classical sorting algorithms . 4th Italian Conference on Algorithms and Complexity. Lecture Notes in Computer Science. Vol. 1767. Rome. pp. 150– 162. ISBN 3-540-67159-5 . Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Cantone, Domenico; Concotti, Gianluca (1–3 March 2000). QuickHeapsort, an efficient mix of classical sorting algorithms . 4th Italian Conference on Algorithms and Complexity. Lecture Notes in Computer Science. Vol. 1767. Rome. pp. 150– 162. ISBN 3-540-67159-5 . Wikipedia revision 1373708813, retrieved 2026-11-22." Cantone, Domenico; Concotti, Gianluca (1–3 March 2000). 2026-11-21. https://archive.org/details/springer_10.1007-3-540-46521-9. Accessed 24 November 2026.

    Chicago "Cantone, Domenico; Concotti, Gianluca (1–3 March 2000). QuickHeapsort, an efficient mix of classical sorting algorithms . 4th Italian Conference on Algorithms and Complexity. Lecture Notes in Computer Science. Vol. 1767. Rome. pp. 150– 162. ISBN 3-540-67159-5 . Wikipedia revision 1373708813, retrieved 2026-11-22." Cantone, Domenico; Concotti, Gianluca (1–3 March 2000). 2026-11-21. https://archive.org/details/springer_10.1007-3-540-46521-9.

    APA Cantone, Domenico; Concotti, Gianluca (1–3 March 2000). (2026). Cantone, Domenico; Concotti, Gianluca (1–3 March 2000). QuickHeapsort, an efficient mix of classical sorting algorithms . 4th Italian Conference on Algorithms and Complexity. Lecture Notes in Computer Science. Vol. 1767. Rome. pp. 150– 162. ISBN 3-540-67159-5 . Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://archive.org/details/springer_10.1007-3-540-46521-9

  9. QuickHeapsort, an efficient mix of classical sorting algorithms · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "QuickHeapsort, an efficient mix of classical sorting algorithms." Cantone, Domenico; Concotti, Gianluca (August 2002). 2026-11-21. https://core.ac.uk/download/pdf/81957449.pdf. Accessed 24 November 2026.

    Chicago "QuickHeapsort, an efficient mix of classical sorting algorithms." Cantone, Domenico; Concotti, Gianluca (August 2002). 2026-11-21. https://core.ac.uk/download/pdf/81957449.pdf.

    APA Cantone, Domenico; Concotti, Gianluca (August 2002). (2026). QuickHeapsort, an efficient mix of classical sorting algorithms. Retrieved November 24, 2026, from https://core.ac.uk/download/pdf/81957449.pdf

  10. QuickHeapsort: Modifications and improved analysis · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "QuickHeapsort: Modifications and improved analysis." Diekert, Volker; Weiß, Armin (August 2016). 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier). Accessed 24 November 2026.

    Chicago "QuickHeapsort: Modifications and improved analysis." Diekert, Volker; Weiß, Armin (August 2016). 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier).

    APA Diekert, Volker; Weiß, Armin (August 2016). (2026). QuickHeapsort: Modifications and improved analysis. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ArXiv_(identifier)

  11. Dijkstra, Edsger W. Smoothsort – an alternative to sorting in situ (EWD-796a) (PDF) . E.W. Dijkstra Archive. Center for American History, University of Texas at Austin . ( transcription ) Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Dijkstra, Edsger W. Smoothsort – an alternative to sorting in situ (EWD-796a) (PDF) . E.W. Dijkstra Archive. Center for American History, University of Texas at Austin . ( transcription ) Wikipedia revision 1373708813, retrieved 2026-11-22." Dijkstra, Edsger W. 2026-11-21. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra. Accessed 24 November 2026.

    Chicago "Dijkstra, Edsger W. Smoothsort – an alternative to sorting in situ (EWD-796a) (PDF) . E.W. Dijkstra Archive. Center for American History, University of Texas at Austin . ( transcription ) Wikipedia revision 1373708813, retrieved 2026-11-22." Dijkstra, Edsger W. 2026-11-21. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra.

    APA Dijkstra, Edsger W. (2026). Dijkstra, Edsger W. Smoothsort – an alternative to sorting in situ (EWD-796a) (PDF) . E.W. Dijkstra Archive. Center for American History, University of Texas at Austin . ( transcription ) Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Edsger_W._Dijkstra

  12. Heapsort—Adapted for Presorted Files · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Heapsort—Adapted for Presorted Files." Levcopoulos, Christos; Petersson, Ola (1989). 2026-11-21. https://en.wikipedia.org/wiki/Doi_(identifier). Accessed 24 November 2026.

    Chicago "Heapsort—Adapted for Presorted Files." Levcopoulos, Christos; Petersson, Ola (1989). 2026-11-21. https://en.wikipedia.org/wiki/Doi_(identifier).

    APA Levcopoulos, Christos; Petersson, Ola (1989). (2026). Heapsort—Adapted for Presorted Files. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Doi_(identifier)

  13. CartesianTreeSort.hh · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "CartesianTreeSort.hh." Schwartz, Keith (27 December 2010). 2026-11-21. http://www.keithschwarz.com/interesting/code/?dir=cartesian-tree-sort. Accessed 24 November 2026.

    Chicago "CartesianTreeSort.hh." Schwartz, Keith (27 December 2010). 2026-11-21. http://www.keithschwarz.com/interesting/code/?dir=cartesian-tree-sort.

    APA Schwartz, Keith (27 December 2010). (2026). CartesianTreeSort.hh. Retrieved November 24, 2026, from http://www.keithschwarz.com/interesting/code/?dir=cartesian-tree-sort

  14. Katajainen, Jyrki (2–3 February 1998). The Ultimate Heapsort . Computing: the 4th Australasian Theory Symposium. Australian Computer Science Communications . Vol. 20, no. 3. Perth. pp. 87– 96. Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Katajainen, Jyrki (2–3 February 1998). The Ultimate Heapsort . Computing: the 4th Australasian Theory Symposium. Australian Computer Science Communications . Vol. 20, no. 3. Perth. pp. 87– 96. Wikipedia revision 1373708813, retrieved 2026-11-22." Katajainen, Jyrki (2–3 February 1998). 2026-11-21. http://hjemmesider.diku.dk/~jyrki/Myris/Kat1998C.html. Accessed 24 November 2026.

    Chicago "Katajainen, Jyrki (2–3 February 1998). The Ultimate Heapsort . Computing: the 4th Australasian Theory Symposium. Australian Computer Science Communications . Vol. 20, no. 3. Perth. pp. 87– 96. Wikipedia revision 1373708813, retrieved 2026-11-22." Katajainen, Jyrki (2–3 February 1998). 2026-11-21. http://hjemmesider.diku.dk/~jyrki/Myris/Kat1998C.html.

    APA Katajainen, Jyrki (2–3 February 1998). (2026). Katajainen, Jyrki (2–3 February 1998). The Ultimate Heapsort . Computing: the 4th Australasian Theory Symposium. Australian Computer Science Communications . Vol. 20, no. 3. Perth. pp. 87– 96. Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from http://hjemmesider.diku.dk/~jyrki/Myris/Kat1998C.html

  15. Cormen, Thomas H.; Leiserson, Charles Eric; Rivest, Ronald L.; Stein, Clifford (2022). Introduction to algorithms (4th ed.). Cambridge, Massachusetts: The MIT Press. p. 170. ISBN 978-0-262-04630-5 . Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Cormen, Thomas H.; Leiserson, Charles Eric; Rivest, Ronald L.; Stein, Clifford (2022). Introduction to algorithms (4th ed.). Cambridge, Massachusetts: The MIT Press. p. 170. ISBN 978-0-262-04630-5 . Wikipedia revision 1373708813, retrieved 2026-11-22." Cormen, Thomas H. 2026-11-21. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.

    Chicago "Cormen, Thomas H.; Leiserson, Charles Eric; Rivest, Ronald L.; Stein, Clifford (2022). Introduction to algorithms (4th ed.). Cambridge, Massachusetts: The MIT Press. p. 170. ISBN 978-0-262-04630-5 . Wikipedia revision 1373708813, retrieved 2026-11-22." Cormen, Thomas H. 2026-11-21. https://en.wikipedia.org/wiki/ISBN_(identifier).

    APA Cormen, Thomas H. (2026). Cormen, Thomas H.; Leiserson, Charles Eric; Rivest, Ronald L.; Stein, Clifford (2022). Introduction to algorithms (4th ed.). Cambridge, Massachusetts: The MIT Press. p. 170. ISBN 978-0-262-04630-5 . Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)

  16. Pattern-defeating Quicksort · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Pattern-defeating Quicksort." Peters, Orson R. 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier). Accessed 24 November 2026.

    Chicago "Pattern-defeating Quicksort." Peters, Orson R. 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier).

    APA Peters, Orson R. (2026). Pattern-defeating Quicksort. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ArXiv_(identifier)

  17. Comparing Quick and Heap Sorts · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Comparing Quick and Heap Sorts." Morris, John (1998). 2026-11-21. https://www.cs.auckland.ac.nz/software/AlgAnim/qsort3.html. Accessed 24 November 2026.

    Chicago "Comparing Quick and Heap Sorts." Morris, John (1998). 2026-11-21. https://www.cs.auckland.ac.nz/software/AlgAnim/qsort3.html.

    APA Morris, John (1998). (2026). Comparing Quick and Heap Sorts. Retrieved November 24, 2026, from https://www.cs.auckland.ac.nz/software/AlgAnim/qsort3.html

  18. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source Wikipedia revision 1373708813, retrieved 2026-11-22." https://git. 2026-11-21. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205. Accessed 24 November 2026.

    Chicago "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source Wikipedia revision 1373708813, retrieved 2026-11-22." https://git. 2026-11-21. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205.

    APA https://git. (2026). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205

  19. Sorting by generating the sorting permutation, and the effect of caching on sorting · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Sorting by generating the sorting permutation, and the effect of caching on sorting." Maus, Arne [in Norwegian] (14 May 2014). 2026-11-21. https://no.wikipedia.org/wiki/Arne_Maus. Accessed 24 November 2026.

    Chicago "Sorting by generating the sorting permutation, and the effect of caching on sorting." Maus, Arne [in Norwegian] (14 May 2014). 2026-11-21. https://no.wikipedia.org/wiki/Arne_Maus.

    APA Maus, Arne [in Norwegian] (14 May 2014). (2026). Sorting by generating the sorting permutation, and the effect of caching on sorting. Retrieved November 24, 2026, from https://no.wikipedia.org/wiki/Arne_Maus

  20. BlockQuicksort: Avoiding Branch Mispredictions in Quicksort · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "BlockQuicksort: Avoiding Branch Mispredictions in Quicksort." Edelkamp, Stefan; Weiß, Armin (30 January 2019). 2026-11-21. https://en.wikipedia.org/wiki/Armin_Weiss. Accessed 24 November 2026.

    Chicago "BlockQuicksort: Avoiding Branch Mispredictions in Quicksort." Edelkamp, Stefan; Weiß, Armin (30 January 2019). 2026-11-21. https://en.wikipedia.org/wiki/Armin_Weiss.

    APA Edelkamp, Stefan; Weiß, Armin (30 January 2019). (2026). BlockQuicksort: Avoiding Branch Mispredictions in Quicksort. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Armin_Weiss

  21. Aumüller, Martin; Hass, Nikolaj (7–8 January 2019). Simple and Fast BlockQuicksort using Lomuto's Partitioning Scheme . Twenty-First Workshop on Algorithm Engineering and Experiments (ALENEX). San Diego. arXiv : 1810.12047 . doi : 10.1137/1.9781611975499.2 . Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Aumüller, Martin; Hass, Nikolaj (7–8 January 2019). Simple and Fast BlockQuicksort using Lomuto's Partitioning Scheme . Twenty-First Workshop on Algorithm Engineering and Experiments (ALENEX). San Diego. arXiv : 1810.12047 . doi : 10.1137/1.9781611975499.2 . Wikipedia revision 1373708813, retrieved 2026-11-22." Aumüller, Martin; Hass, Nikolaj (7–8 January 2019). 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier). Accessed 24 November 2026.

    Chicago "Aumüller, Martin; Hass, Nikolaj (7–8 January 2019). Simple and Fast BlockQuicksort using Lomuto's Partitioning Scheme . Twenty-First Workshop on Algorithm Engineering and Experiments (ALENEX). San Diego. arXiv : 1810.12047 . doi : 10.1137/1.9781611975499.2 . Wikipedia revision 1373708813, retrieved 2026-11-22." Aumüller, Martin; Hass, Nikolaj (7–8 January 2019). 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier).

    APA Aumüller, Martin; Hass, Nikolaj (7–8 January 2019). (2026). Aumüller, Martin; Hass, Nikolaj (7–8 January 2019). Simple and Fast BlockQuicksort using Lomuto's Partitioning Scheme . Twenty-First Workshop on Algorithm Engineering and Experiments (ALENEX). San Diego. arXiv : 1810.12047 . doi : 10.1137/1.9781611975499.2 . Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ArXiv_(identifier)

  22. Williams 1964 Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Williams 1964 Wikipedia revision 1373708813, retrieved 2026-11-22." 2026-11-21. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Williams 1964 Wikipedia revision 1373708813, retrieved 2026-11-22." 2026-11-21. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA encyclopegia.org. (2026). Williams 1964 Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  23. Elementary Yet Precise Worst-Case Analysis of Floyd's Heap-Construction Program · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Elementary Yet Precise Worst-Case Analysis of Floyd's Heap-Construction Program." Suchenek, Marek A. 2026-11-21. https://en.wikipedia.org/wiki/Fundamenta_Informaticae. Accessed 24 November 2026.

    Chicago "Elementary Yet Precise Worst-Case Analysis of Floyd's Heap-Construction Program." Suchenek, Marek A. 2026-11-21. https://en.wikipedia.org/wiki/Fundamenta_Informaticae.

    APA Suchenek, Marek A. (2026). Elementary Yet Precise Worst-Case Analysis of Floyd's Heap-Construction Program. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Fundamenta_Informaticae

  24. A Complete Worst-Case Analysis of Heapsort with Experimental Verification of Its Results, A manuscript · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "A Complete Worst-Case Analysis of Heapsort with Experimental Verification of Its Results, A manuscript." Suchenek, Marek A. 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier). Accessed 24 November 2026.

    Chicago "A Complete Worst-Case Analysis of Heapsort with Experimental Verification of Its Results, A manuscript." Suchenek, Marek A. 2026-11-21. https://en.wikipedia.org/wiki/ArXiv_(identifier).

    APA Suchenek, Marek A. (2026). A Complete Worst-Case Analysis of Heapsort with Experimental Verification of Its Results, A manuscript. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ArXiv_(identifier)

  25. Knuth 1997 Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Knuth 1997 Wikipedia revision 1373708813, retrieved 2026-11-22." 2026-11-21. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Knuth 1997 Wikipedia revision 1373708813, retrieved 2026-11-22." 2026-11-21. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA encyclopegia.org. (2026). Knuth 1997 Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  26. Performance Engineering Case Study: Heap Construction · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Performance Engineering Case Study: Heap Construction." a b c Bojesen, Jesper; Katajainen, Jyrki; Spork, Maz (2000). 2026-11-21. http://hjemmesider.diku.dk/~jyrki/Paper/katajain.ps. Accessed 24 November 2026.

    Chicago "Performance Engineering Case Study: Heap Construction." a b c Bojesen, Jesper; Katajainen, Jyrki; Spork, Maz (2000). 2026-11-21. http://hjemmesider.diku.dk/~jyrki/Paper/katajain.ps.

    APA a b c Bojesen, Jesper; Katajainen, Jyrki; Spork, Maz (2000). (2026). Performance Engineering Case Study: Heap Construction. Retrieved November 24, 2026, from http://hjemmesider.diku.dk/~jyrki/Paper/katajain.ps

  27. A variant of heapsort with almost optimal number of comparisons · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "A variant of heapsort with almost optimal number of comparisons." a b Carlsson, Scante (March 1987). 2026-11-21. https://web.archive.org/web/20161227055904/https://pdfs.semanticscholar.org/caec/6682ffd13c6367a8c51b566e2420246faca2.pdf. Accessed 24 November 2026.

    Chicago "A variant of heapsort with almost optimal number of comparisons." a b Carlsson, Scante (March 1987). 2026-11-21. https://web.archive.org/web/20161227055904/https://pdfs.semanticscholar.org/caec/6682ffd13c6367a8c51b566e2420246faca2.pdf.

    APA a b Carlsson, Scante (March 1987). (2026). A variant of heapsort with almost optimal number of comparisons. Retrieved November 24, 2026, from https://web.archive.org/web/20161227055904/https://pdfs.semanticscholar.org/caec/6682ffd13c6367a8c51b566e2420246faca2.pdf

  28. Katajainen, Jyrki (23 September 2013). Seeking for the best priority queue: Lessons learnt . Algorithm Engineering (Seminar 13391). Dagstuhl. pp. 19– 20, 24. Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Katajainen, Jyrki (23 September 2013). Seeking for the best priority queue: Lessons learnt . Algorithm Engineering (Seminar 13391). Dagstuhl. pp. 19– 20, 24. Wikipedia revision 1373708813, retrieved 2026-11-22." Katajainen, Jyrki (23 September 2013). 2026-11-21. http://hjemmesider.diku.dk/~jyrki/Myris/Kat2013-09-23P.html. Accessed 24 November 2026.

    Chicago "Katajainen, Jyrki (23 September 2013). Seeking for the best priority queue: Lessons learnt . Algorithm Engineering (Seminar 13391). Dagstuhl. pp. 19– 20, 24. Wikipedia revision 1373708813, retrieved 2026-11-22." Katajainen, Jyrki (23 September 2013). 2026-11-21. http://hjemmesider.diku.dk/~jyrki/Myris/Kat2013-09-23P.html.

    APA Katajainen, Jyrki (23 September 2013). (2026). Katajainen, Jyrki (23 September 2013). Seeking for the best priority queue: Lessons learnt . Algorithm Engineering (Seminar 13391). Dagstuhl. pp. 19– 20, 24. Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from http://hjemmesider.diku.dk/~jyrki/Myris/Kat2013-09-23P.html

  29. The Influence of Caches on the Performance of Sorting · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "The Influence of Caches on the Performance of Sorting." a b c LaMarca, Anthony; Ladner, Richard E. 2026-11-21. https://en.wikipedia.org/wiki/Richard_E._Ladner. Accessed 24 November 2026.

    Chicago "The Influence of Caches on the Performance of Sorting." a b c LaMarca, Anthony; Ladner, Richard E. 2026-11-21. https://en.wikipedia.org/wiki/Richard_E._Ladner.

    APA a b c LaMarca, Anthony; Ladner, Richard E. (2026). The Influence of Caches on the Performance of Sorting. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Richard_E._Ladner

  30. Heapsort, Quicksort, and Entropy · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Heapsort, Quicksort, and Entropy." a b MacKay, David J. 2026-11-21. https://en.wikipedia.org/wiki/David_J._C._MacKay. Accessed 24 November 2026.

    Chicago "Heapsort, Quicksort, and Entropy." a b MacKay, David J. 2026-11-21. https://en.wikipedia.org/wiki/David_J._C._MacKay.

    APA a b MacKay, David J. (2026). Heapsort, Quicksort, and Entropy. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/David_J._C._MacKay

  31. Building heaps fast · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Building heaps fast." a b McDiarmid, C. 2026-11-21. http://cgm.cs.mcgill.ca/~breed/2016COMP610/BUILDINGHEAPSFAST.pdf. Accessed 24 November 2026.

    Chicago "Building heaps fast." a b McDiarmid, C. 2026-11-21. http://cgm.cs.mcgill.ca/~breed/2016COMP610/BUILDINGHEAPSFAST.pdf.

    APA a b McDiarmid, C. (2026). Building heaps fast. Retrieved November 24, 2026, from http://cgm.cs.mcgill.ca/~breed/2016COMP610/BUILDINGHEAPSFAST.pdf

  32. Priority Queues · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Priority Queues." a b Mehlhorn, Kurt ; Sanders, Peter (2008). 2026-11-21. https://en.wikipedia.org/wiki/Kurt_Mehlhorn. Accessed 24 November 2026.

    Chicago "Priority Queues." a b Mehlhorn, Kurt ; Sanders, Peter (2008). 2026-11-21. https://en.wikipedia.org/wiki/Kurt_Mehlhorn.

    APA a b Mehlhorn, Kurt ; Sanders, Peter (2008). (2026). Priority Queues. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Kurt_Mehlhorn

  33. Bottom-Up Heapsort, a new variant of Heapsort beating, on an average, Quicksort (if n is not very small) · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "Bottom-Up Heapsort, a new variant of Heapsort beating, on an average, Quicksort (if n is not very small)." a b c Wegener, Ingo (13 September 1993). 2026-11-21. https://en.wikipedia.org/wiki/Ingo_Wegener. Accessed 24 November 2026.

    Chicago "Bottom-Up Heapsort, a new variant of Heapsort beating, on an average, Quicksort (if n is not very small)." a b c Wegener, Ingo (13 September 1993). 2026-11-21. https://en.wikipedia.org/wiki/Ingo_Wegener.

    APA a b c Wegener, Ingo (13 September 1993). (2026). Bottom-Up Heapsort, a new variant of Heapsort beating, on an average, Quicksort (if n is not very small). Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Ingo_Wegener

  34. a b Brass, Peter (2008). Advanced Data Structures . Cambridge University Press. p. 209. ISBN 978-0-521-88037-4 . Wikipedia revision 1373708813, retrieved 2026-11-22 · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "a b Brass, Peter (2008). Advanced Data Structures . Cambridge University Press. p. 209. ISBN 978-0-521-88037-4 . Wikipedia revision 1373708813, retrieved 2026-11-22." a b Brass, Peter (2008). 2026-11-21. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.

    Chicago "a b Brass, Peter (2008). Advanced Data Structures . Cambridge University Press. p. 209. ISBN 978-0-521-88037-4 . Wikipedia revision 1373708813, retrieved 2026-11-22." a b Brass, Peter (2008). 2026-11-21. https://en.wikipedia.org/wiki/ISBN_(identifier).

    APA a b Brass, Peter (2008). (2026). a b Brass, Peter (2008). Advanced Data Structures . Cambridge University Press. p. 209. ISBN 978-0-521-88037-4 . Wikipedia revision 1373708813, retrieved 2026-11-22. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)

  35. A tight lower bound for the worst case of Bottom-Up-Heapsort · retrieved 2026-11-21 · rev 1373708813
    Cite this reference

    MLA "A tight lower bound for the worst case of Bottom-Up-Heapsort." a b c Fleischer, Rudolf (February 1994). 2026-11-21. https://web.archive.org/web/20180614144211/http://staff.gutech.edu.om/~rudolf/Paper/buh_algorithmica94.pdf. Accessed 24 November 2026.

    Chicago "A tight lower bound for the worst case of Bottom-Up-Heapsort." a b c Fleischer, Rudolf (February 1994). 2026-11-21. https://web.archive.org/web/20180614144211/http://staff.gutech.edu.om/~rudolf/Paper/buh_algorithmica94.pdf.

    APA a b c Fleischer, Rudolf (February 1994). (2026). A tight lower bound for the worst case of Bottom-Up-Heapsort. Retrieved November 24, 2026, from https://web.archive.org/web/20180614144211/http://staff.gutech.edu.om/~rudolf/Paper/buh_algorithmica94.pdf

  36. Bollobás, B. On the Best Case of Heapsort . 1996. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Bollobás, B. On the Best Case of Heapsort . 1996." Bollobás, B. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Bollobás, B. On the Best Case of Heapsort . 1996." Bollobás, B. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Bollobás, B. (2026). Bollobás, B. On the Best Case of Heapsort . 1996. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  37. Chen, Jingsen. web.archive.org . (archived copy) · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Chen, Jingsen. web.archive.org . (archived copy)." Chen, Jingsen. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Chen, Jingsen. web.archive.org . (archived copy)." Chen, Jingsen. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Chen, Jingsen. (2026). Chen, Jingsen. web.archive.org . (archived copy). Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  38. Cantone, Domenico. QuickHeapsort, an efficient mix of classical sorting algorithms . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Cantone, Domenico. QuickHeapsort, an efficient mix of classical sorting algorithms ." Cantone, Domenico. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Cantone, Domenico. QuickHeapsort, an efficient mix of classical sorting algorithms ." Cantone, Domenico. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Cantone, Domenico. (2026). Cantone, Domenico. QuickHeapsort, an efficient mix of classical sorting algorithms . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  39. Schwartz, Keith. CartesianTreeSort.hh . Archive of Interesting Code . 27 December 201. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Schwartz, Keith. CartesianTreeSort.hh . Archive of Interesting Code . 27 December 201." Schwartz, Keith. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Schwartz, Keith. CartesianTreeSort.hh . Archive of Interesting Code . 27 December 201." Schwartz, Keith. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Schwartz, Keith. (2026). Schwartz, Keith. CartesianTreeSort.hh . Archive of Interesting Code . 27 December 201. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  40. Katajainen, Jyrki. Seeking for the best priority queue: Lessons learnt . 23 September 2013. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Katajainen, Jyrki. Seeking for the best priority queue: Lessons learnt . 23 September 2013." Katajainen, Jyrki. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Katajainen, Jyrki. Seeking for the best priority queue: Lessons learnt . 23 September 2013." Katajainen, Jyrki. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Katajainen, Jyrki. (2026). Katajainen, Jyrki. Seeking for the best priority queue: Lessons learnt . 23 September 2013. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  41. Katajainen, Jyrki. The Ultimate Heapsort . 2–3 February 1998. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Katajainen, Jyrki. The Ultimate Heapsort . 2–3 February 1998." Katajainen, Jyrki. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Katajainen, Jyrki. The Ultimate Heapsort . 2–3 February 1998." Katajainen, Jyrki. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Katajainen, Jyrki. (2026). Katajainen, Jyrki. The Ultimate Heapsort . 2–3 February 1998. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  42. Peters, Orson R. L. Pattern-defeating Quicksort . 9 Jun 2021. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Peters, Orson R. L. Pattern-defeating Quicksort . 9 Jun 2021." Peters, Orson R. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Peters, Orson R. L. Pattern-defeating Quicksort . 9 Jun 2021." Peters, Orson R. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Peters, Orson R. (2026). Peters, Orson R. L. Pattern-defeating Quicksort . 9 Jun 2021. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  43. Morris, John. Comparing Quick and Heap Sorts . Data Structures and Algorithms . 1998. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Morris, John. Comparing Quick and Heap Sorts . Data Structures and Algorithms . 1998." Morris, John. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Morris, John. Comparing Quick and Heap Sorts . Data Structures and Algorithms . 1998." Morris, John. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Morris, John. (2026). Morris, John. Comparing Quick and Heap Sorts . Data Structures and Algorithms . 1998. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  44. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source ." https://git. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source ." https://git. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA https://git. (2026). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/sort.c#n205 Linux kernel source . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  45. LaMarca, Anthony. The Influence of Caches on the Performance of Sorting . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "LaMarca, Anthony. The Influence of Caches on the Performance of Sorting ." LaMarca, Anthony. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "LaMarca, Anthony. The Influence of Caches on the Performance of Sorting ." LaMarca, Anthony. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA LaMarca, Anthony. (2026). LaMarca, Anthony. The Influence of Caches on the Performance of Sorting . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  46. Maus, Arne. Sorting by generating the sorting permutation, and the effect of caching on sorting . 14 May 2014. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Maus, Arne. Sorting by generating the sorting permutation, and the effect of caching on sorting . 14 May 2014." Maus, Arne. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Maus, Arne. Sorting by generating the sorting permutation, and the effect of caching on sorting . 14 May 2014." Maus, Arne. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Maus, Arne. (2026). Maus, Arne. Sorting by generating the sorting permutation, and the effect of caching on sorting . 14 May 2014. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  47. Sedgewick, Robert. The Best Case of Heapsort . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Sedgewick, Robert. The Best Case of Heapsort ." Sedgewick, Robert. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Sedgewick, Robert. The Best Case of Heapsort ." Sedgewick, Robert. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Sedgewick, Robert. (2026). Sedgewick, Robert. The Best Case of Heapsort . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  48. Edelkamp, Stefan. BlockQuicksort: Avoiding Branch Mispredictions in Quicksort . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Edelkamp, Stefan. BlockQuicksort: Avoiding Branch Mispredictions in Quicksort ." Edelkamp, Stefan. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Edelkamp, Stefan. BlockQuicksort: Avoiding Branch Mispredictions in Quicksort ." Edelkamp, Stefan. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Edelkamp, Stefan. (2026). Edelkamp, Stefan. BlockQuicksort: Avoiding Branch Mispredictions in Quicksort . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  49. MacKay, David J. C. Heapsort, Quicksort, and Entropy . December 2005. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "MacKay, David J. C. Heapsort, Quicksort, and Entropy . December 2005." MacKay, David J. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "MacKay, David J. C. Heapsort, Quicksort, and Entropy . December 2005." MacKay, David J. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA MacKay, David J. (2026). MacKay, David J. C. Heapsort, Quicksort, and Entropy . December 2005. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  50. Fleischer, Rudolf. A tight lower bound for the worst case of Bottom-Up-Heapsort . February 1994. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Fleischer, Rudolf. A tight lower bound for the worst case of Bottom-Up-Heapsort . February 1994." Fleischer, Rudolf. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Fleischer, Rudolf. A tight lower bound for the worst case of Bottom-Up-Heapsort . February 1994." Fleischer, Rudolf. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Fleischer, Rudolf. (2026). Fleischer, Rudolf. A tight lower bound for the worst case of Bottom-Up-Heapsort . February 1994. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  51. procedure siftDown(a, i, end) is j ← leafSearch(a, i, end) while a[i] > a[j] do j ← iParent(j) while j > i do swap(a[i], a[j]) j ← iParent(j) Bottom-up heapsort was . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "procedure siftDown(a, i, end) is j ← leafSearch(a, i, end) while a[i] > a[j] do j ← iParent(j) while j > i do swap(a[i], a[j]) j ← iParent(j) Bottom-up heapsort was ." procedure siftDown(a, i, end) is j ← leafSearch(a, i, end) while a[i] > a[j] do j ← iParent(j) while j > i do swap(a[i],. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "procedure siftDown(a, i, end) is j ← leafSearch(a, i, end) while a[i] > a[j] do j ← iParent(j) while j > i do swap(a[i], a[j]) j ← iParent(j) Bottom-up heapsort was ." procedure siftDown(a, i, end) is j ← leafSearch(a, i, end) while a[i] > a[j] do j ← iParent(j) while j > i do swap(a[i],. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA procedure siftDown(a, i, end) is j ← leafSearch(a, i, end) while a[i] > a[j] do j ← iParent(j) while j > i do swap(a[i],. (2026). procedure siftDown(a, i, end) is j ← leafSearch(a, i, end) while a[i] > a[j] do j ← iParent(j) while j > i do swap(a[i], a[j]) j ← iParent(j) Bottom-up heapsort was . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  52. Carlsson, Scante. A variant of heapsort with almost optimal number of comparisons . Marc. · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Carlsson, Scante. A variant of heapsort with almost optimal number of comparisons . Marc." Carlsson, Scante. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Carlsson, Scante. A variant of heapsort with almost optimal number of comparisons . Marc." Carlsson, Scante. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Carlsson, Scante. (2026). Carlsson, Scante. A variant of heapsort with almost optimal number of comparisons . Marc. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  53. Building heaps fast . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Building heaps fast ." 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Building heaps fast ." 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA encyclopegia.org. (2026). Building heaps fast . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  54. Bojesen, Jesper. Performance Engineering Case Study: Heap Construction . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Bojesen, Jesper. Performance Engineering Case Study: Heap Construction ." Bojesen, Jesper. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Bojesen, Jesper. Performance Engineering Case Study: Heap Construction ." Bojesen, Jesper. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Bojesen, Jesper. (2026). Bojesen, Jesper. Performance Engineering Case Study: Heap Construction . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

  55. Chen, Jingsen. pdfs.semanticscholar.org . · retrieved 2026-09-06 · rev 1373708813
    Cite this reference

    MLA "Chen, Jingsen. pdfs.semanticscholar.org ." Chen, Jingsen. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813. Accessed 24 November 2026.

    Chicago "Chen, Jingsen. pdfs.semanticscholar.org ." Chen, Jingsen. 2026-09-06. https://en.wikipedia.org/w/index.php?oldid=1373708813.

    APA Chen, Jingsen. (2026). Chen, Jingsen. pdfs.semanticscholar.org . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1373708813

Cite this article

MLA

"Heapsort." encyclopegia.org, 2026, https://encyclopegia.org/wiki/heapsort. Accessed 24 November 2026.

Chicago

"Heapsort." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/heapsort.

APA

encyclopegia.org. (2026). Heapsort. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/heapsort

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1373708813 · 0.5 · snapshot enwiki-001373708813

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.