Exemple #1
0
 def main_heap(self, lst):
     # build heap
     hp = MaxBinaryHeap(lst)
     # sort by heap
     for i in range(len(lst) - 1, -1, -1):
         lst[i] = hp.pop()
     return lst
Exemple #2
0
 def main(self, lst):
     return MaxBinaryHeap.heapsort(lst)