Are you sure you're getting this? Fill in the missing part by typing it in.
Heap Sort is a comparison-based sorting algorithm that uses a binary heap data structure to sort elements. It has a time complexity of O(n log n). The Heap Sort algorithm consists of the following steps:
- Build a ____ from the input data.
- Swap the root node with the last node and remove the last node from the heap.
- Repeat steps 2 and 3 until the heap is empty.
- Restore the heap property by comparing the swapped element with its children and swapping if necessary.
Write the missing line below.