MCPcopy Index your code
hub / github.com/RustPython/RustPython / heapify_max

Function heapify_max

Lib/heapq.py:211–215  ·  view source on GitHub ↗

Transform list into a maxheap, in-place, in O(len(x)) time.

(x)

Source from the content-addressed store, hash-verified

209 return item
210
211def heapify_max(x):
212 """Transform list into a maxheap, in-place, in O(len(x)) time."""
213 n = len(x)
214 for i in reversed(range(n//2)):
215 _siftup_max(x, i)
216
217
218# 'heap' is a heap at all indices >= startpos, except possibly for pos. pos

Callers 1

nsmallestFunction · 0.85

Calls 3

lenFunction · 0.85
reversedFunction · 0.85
_siftup_maxFunction · 0.85

Tested by

no test coverage detected