Refer to the website

www.runoob.com/python3/pyt… The website has moving pictures

What is heap sort

Heap sort refers to a sort algorithm designed by using Heap data structure. Heap is a nearly complete binary tree structure, and also satisfies the property of heap: that is, the key value or index of the child node is always smaller (or larger) than its parent node. And the big top heap and the small top heap. Heap sort can be said to be a selection sort that uses the concept of heap to sort.Copy the code

code

Copy the code