offer

suspend fun offer(value: Float): Float

Inserts a value into this heap.

If the number of values would exceed the heap's maxSize, the least value is discarded

Return

the new 'top' element in the queue.

Parameters

value

the value to add


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

Inserts array of values into this heap.

Values must be sorted in ascending order.

Return

the new 'top' element in the queue.

Parameters

values

a set of values to insert, must be sorted in ascending order

len

number of values from the values array to insert