mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
Update code extractor of Java.
This commit is contained in:
@ -6,14 +6,10 @@
|
||||
|
||||
import utils
|
||||
|
||||
/* 大顶堆 */
|
||||
class MaxHeap {
|
||||
private var maxHeap: [Int]
|
||||
|
||||
/* 构造函数,建立空堆 */
|
||||
init() {
|
||||
maxHeap = []
|
||||
}
|
||||
|
||||
/* 构造函数,根据输入列表建堆 */
|
||||
init(nums: [Int]) {
|
||||
// 将列表元素原封不动添加进堆
|
||||
|
||||
Reference in New Issue
Block a user