Explain heap sort and heapify.