PriorityQueue

Constructors

Link copied to clipboard
constructor(initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, comparator: Comparator<in E> = Comparator { a, b -> (a as Comparable<E>).compareTo(b) })

Creates a PriorityQueue with the specified initial capacity that orders its elements according to the specified comparator.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
Link copied to clipboard
fun offer(element: E?): Boolean

Inserts the specified element into this priority queue.

Link copied to clipboard
fun peek(): E?
Link copied to clipboard
fun poll(): E?
Link copied to clipboard
fun size(): Int
Link copied to clipboard

Returns an array containing all of the elements in this priority queue.