BlockingFloatHeap

class BlockingFloatHeap(maxSize: Int)

A blocking bounded min heap that stores floats. The top element is the lowest value of the heap.

A primitive priority queue that maintains a partial ordering of its elements such that the least element can always be found in constant time. Implementation is based on org.gnit.lucenekmp.util.LongHeap

Constructors

Link copied to clipboard
constructor(maxSize: Int)

Functions

Link copied to clipboard
suspend fun offer(value: Float): Float

Inserts a value into this heap.

suspend fun offer(values: FloatArray, len: Int): Float

Inserts array of values into this heap.

Link copied to clipboard
suspend fun peek(): Float

Retrieves, but does not remove, the head of this heap.

Link copied to clipboard
suspend fun poll(): Float

Removes and returns the head of the heap

Link copied to clipboard
suspend fun size(): Int

Returns the number of elements in this heap.