from heapq import heappop, heappushdef heap_sort(array):"""堆排序Example:>>> myArray = [36, 25, 48, 12, 25, 65, 43, 57]>>> [12, 25, 25, 36, 43, 48, 57, 65]"""h = []for value in array:heappush(h, value)return [heappop(h) for _ in range(len(h))]
