MCPcopy Index your code
hub / github.com/hustcc/JS-Sorting-Algorithm / heapSort

Function heapSort

src/pythonSortTest.py:152–160  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

150
151
152def heapSort(arr):
153 global arrLen
154 arrLen = len(arr)
155 buildMaxHeap(arr)
156 for i in range(len(arr) - 1, 0, -1):
157 swap(arr, 0, i)
158 arrLen -= 1
159 heapify(arr, 0)
160 return arr
161
162
163def countingSort(arr, maxValue=None):

Callers

nothing calls this directly

Calls 3

buildMaxHeapFunction · 0.70
swapFunction · 0.70
heapifyFunction · 0.70

Tested by

no test coverage detected