This project decomposes the common written interview questions of major factories, traces the source to the underlying implementation principles of data structures and algorithms, and knows what they are.
Establish a knowledge structure system for easy search, welcome more like-minded friends to join the project AlgorithmPractice, (issues and pull requests are welcome).
What is heap sort
The array is stored according to the tree structure, that is, if the left child of the array exists, it is stored in 2 i+1 bits, and if the right child exists, it is stored in 2 i+2 bits.
A heap is a complete binary tree with the following properties: the value of each node is greater than or equal to the value of its left and right child nodes, which is called a big top heap; or the value of each node is less than or equal to the value of its left and right child nodes Value, called small top heap