Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Jack-Lee-Hiter/AlgorithmsByPython
/ __init__
Method
__init__
BinaryHeap.py:3–5 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
1
# 构建树实现堆
2
class
BinHeap:
3
def
__init__(self):
4
self.heapList = [0]
5
self.currentSize = 0
6
7
#插入新结点后必要时交换子节点和父节点的位置保持堆的性质
8
def
percUp(self, i):
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected