PriorityQueue

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.

Parameters

initialCapacity

the initial capacity for this priority queue

comparator

the comparator that will be used to order this priority queue. If null, the natural ordering of the elements will be used.

Throws

if initialCapacity is less than 1