Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ build_heap_max
Function
build_heap_max
recipes/Python/577688_heap_sort/recipe-577688.py:15–18 ·
view source on GitHub ↗
(array)
Source
from the content-addressed store, hash-verified
13
break
14
15
def
build_heap_max(array):
16
length = len(array)
17
for
i in xrange(length / 2, -1, -1):
18
heapify(array, i, length, max)
19
20
def
heap_sort(array):
21
build_heap_max(array)
Callers
1
heap_sort
Function · 0.85
Calls
2
xrange
Class · 0.85
heapify
Function · 0.70
Tested by
no test coverage detected