✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
State and explain the worst case time complexity of the HeapSort algorithm. Make sure to inlcude both heap methods in your analysis. No explanation no marks.
def heapsort(items):
res = ArrayR(len(items))
heap = ArrayMaxHeap.heapify(items)
for i in range(len(items)):
res[i] = heap.extract_max()
return res
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!