com.mayabot.nlp.algorithm.Heap.kt Maven / Gradle / Ivy
package com.mayabot.nlp.algorithm
/**
* 默认小顶堆。如果需要大顶堆
*
*
*/
class TopHeap(
val maxSize: Int,
val comparator: Comparator,
/**
* false 表示大顶堆
*/
val minTop: Boolean = true
) {
private val data = arrayOfNulls(maxSize)
private var size: Int = 0
fun push(data: T) {
}
private fun heapify() {
}
fun root(): T {
TODO()
}
/**
* 获取里面的所有元素,但是并不是排好序的
*/
fun toList(): List {
TODO()
}
}