Introduction - If you have any usage issues, please Google them yourself
Heap sort heap sort using the root pile ( or small stack top ) the record of the keyword maximum ( or minimum ) of this feature, the present disordered select the maximum (or minimum ) keyword records made simple. ( 1 ) with a large root heap sort of basic ideas of the initial file R[1..N] built a large root pile, the pile as the initial disordered regions of the keywords maximum recorded R[1] (i.e. top ) and disordered regions recorded one of the last R[n] exchange, the new R [1..N-1] and disordered zone ordered region R[n], and satisfy the R[1..N-1].keys≤ R[n].key③due to exchange new root R[1] may violate the heap property, so should be the present disordered R[1..N-1] adjustment for reactor. Then again in the R[1..N-1] keyword best record R[1] and the interval of the last record of a R[n-1] exchange, thus get new disordered and ordered R[1..N-2] R[n-1..N], and still meet the relationship between R[1..N-2].keys≤ R[n-1..N].keys, R[1..N-2] also will adjust for reactor. .