MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / heapSort

Function heapSort

Python/all sorting methods.py:162–170  ·  view source on GitHub ↗
(customList)

Source from the content-addressed store, hash-verified

160 heapify(customList ,n ,smallest)
161
162def heapSort(customList):
163 n = len(customList)
164 for i in range(int(n/2)-1,-1,-1):
165 heapify(customList,n,i)
166
167 for i in range(n-1,0,-1):
168 customList[i],customList[0]=customList[0],customList[i]
169 heapify(customList,i,0)
170 customList.reverse()
171
172
173

Callers 1

Calls 2

heapifyFunction · 0.70
reverseMethod · 0.45

Tested by

no test coverage detected