An sorting algorithm which is not quite as fast as quicksort. It is a "sort-in-place" algorithm and requires no auxiliary storage, which makes it particularly concise and elegant to implement.
Heapsort
See also
Heap, Quicksort, SortingExplore with Wolfram|Alpha
References
Knuth, D. E. The Art of Computer Programming, Vol. 3: Sorting and Searching, 2nd ed. Reading, MA: Addison-Wesley, pp. 144-148, 1998.Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. "Heapsort." §8.3 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 327-329, 1992.Skiena, S. Implementing Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Reading, MA: Addison-Wesley, pp. 38-39, 1990.Referenced on Wolfram|Alpha
HeapsortCite this as:
Weisstein, Eric W. "Heapsort." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Heapsort.html