Heap Sort

Very very ridiculously , I some days ago threw an ariticle about an “enhenced version of heap sort”, which after a scrupulous review betrayed a silly implementation of sorting that can’t be farther from the truth of heap sort, due to damn unawareness of my mistake until scrutinizing some source code interspersed throughout the web. Any way, I could’nt hold my own overreached improvement , but rewrite it in the classical manner. As though failing in an innovaton , I still insist on pubishing my rectified code.

It is an introspection.

Against my original thougt of stupor , heap sort is not so awlful that each time the part to be adjusted shall be adjusted from node of last node’s parent to the top node sequentially! Since we should use such method to initial the whole target array as a strict heap, after this only adjustment of root note is required , if neccessary ( that’s why in classical algorithm use a max heap as the ADT to support an ascending order of array , which amazed me at first ! ) .

/*
using strategy of “filtering through the direction from up to down” to adjust a heap starting at heapStart position
*/

/* when startValue meets its “just” position, note that all nodes alongside this critical comparation path have leveled up by one step, so current blank position is expected to fill “startValue” */ *( heap + current ) = startVal;
}