MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / heapSort

Method heapSort

data_structures/heap/heap.py:58–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56 return None
57
58 def heapSort(self): #This function is used to sort the heap.
59 size = self.currsize
60 while self.currsize-1 >= 0:
61 temp = self.h[0]
62 self.h[0] = self.h[self.currsize-1]
63 self.h[self.currsize-1] = temp
64 self.currsize -= 1
65 self.maxHeapify(0)
66 self.currsize = size
67
68 def insert(self,data): #This function is used to insert data in the heap.
69 self.h.append(data)

Callers 1

mainFunction · 0.95

Calls 1

maxHeapifyMethod · 0.95

Tested by

no test coverage detected