MCPcopy Create free account
hub / github.com/ActiveState/code / heap_sort

Function heap_sort

recipes/Python/577688_heap_sort/recipe-577688.py:20–26  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

18 heapify(array, i, length, max)
19
20def heap_sort(array):
21 build_heap_max(array)
22 size = len(array)
23 while size > 0:
24 array[0], array[size - 1] = array[size - 1], array[0]
25 heapify(array, 0, size - 1, max)
26 size -= 1

Callers

nothing calls this directly

Calls 2

build_heap_maxFunction · 0.85
heapifyFunction · 0.70

Tested by

no test coverage detected