This commit is contained in:
krahets
2023-02-08 20:30:14 +08:00
parent 7156a5f832
commit 30ed83e5b1
10 changed files with 130 additions and 49 deletions

View File

@@ -386,13 +386,6 @@ comments: true
=== "Swift"
```swift title="my_heap.swift"
var maxHeap: [Int]
/* 构造函数,建立空堆 */
init() {
maxHeap = []
}
/* 获取左子结点索引 */
func left(i: Int) -> Int {
2 * i + 1