转载于:https://blog.csdn.net/qq_34228570/article/details/80024306
初始化堆的时间复杂度为O(n),排序重建堆的时间复杂度为nlog(n),所以总的时间复杂度为O(n+nlogn)=O(nlogn)。