Source: wikibot/heapsort
= Heapsort
{wiki=Heapsort}
Heapsort is a comparison-based sorting algorithm that uses a binary heap data structure to sort elements. It is an efficient sorting technique with a time complexity of \\(O(n \\log n)\\) in the average and worst cases. Heapsort can be broken down into two main phases: building the heap and repeatedly extracting the maximum element from the heap. \#\#\# Key Concepts 1.