public class PriorityQueue extends Object
Comparable
objects.Constructor and Description |
---|
PriorityQueue()
Creates a new empty priority queue
|
Modifier and Type | Method and Description |
---|---|
void |
add(Comparable x)
Insert into the priority queue.
|
void |
clear()
Make the priority queue logically empty.
|
boolean |
isEmpty()
Test if the priority queue is logically empty.
|
Object |
poll()
Remove the smallest item from the priority queue.
|
int |
size()
Returns size.
|
public void add(Comparable x)
x
- the item to insert.public boolean isEmpty()
public int size()
public void clear()
public Object poll()
Copyright © 2016. All rights reserved.