only this version of heap sort is correct,the former is wrong