uriel
07/11/2016, 4:42 AMclass BoundedBinaryHeap<T> protected constructor(val max : Int,
arrayFactory: (Int) -> Array<T>) {
companion object {
inline fun <reified T> invoke(max : Int)
= BoundedBinaryHeap(max, { size -> arrayOfNulls<T>(max) })
}
val nodes = arrayFactory(max)
}