FloatHeap

class FloatHeap(maxSize: Int)

A 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 [ ]

Constructors

Link copied to clipboard
constructor(maxSize: Int)

Functions

Link copied to clipboard
fun clear()
Link copied to clipboard
Link copied to clipboard
fun offer(value: Float): Boolean

Inserts a value into this heap.

Link copied to clipboard
fun peek(): Float

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

Link copied to clipboard
fun poll(): Float

Removes and returns the head of the heap

Link copied to clipboard
fun size(): Int

Returns the number of elements in this heap.