T
- the type of the elements of this queuepublic class PriorityQueue<T>
extends java.lang.Object
Constructor and Description |
---|
PriorityQueue(int initialCapacity,
java.util.Comparator<T> comparator) |
Modifier and Type | Method and Description |
---|---|
void |
add(T o)
Adds element to the priority queue.
|
boolean |
isEmpty()
This method returns whether priority queue is empty.
|
T |
removeMin()
This method removes smallest element in queue if there are several equal elements than returns first inserted
first.
|
int |
size()
This method returns element count in priority queue.
|
public PriorityQueue(int initialCapacity, java.util.Comparator<T> comparator)
public int size()
public boolean isEmpty()
true
if priority queue is empty.public T removeMin()
public void add(T o)
o
- element to insert.