| com.google.gwt.emul.java.util.PriorityQueue
PriorityQueue | public class PriorityQueue extends AbstractQueue (Code) | | An unbounded priority queue based on a priority heap. [Sun
docs]
< Parameters: E - > element type. |
Method Summary | |
public Iterator<E> | iterator() | protected void | makeHeap(int node) Make the subtree rooted at node a valid heap. | protected void | mergeHeaps(int node) Merge two subheaps into a single heap. | public boolean | offer(E e) | public E | peek() | public E | poll() | public int | size() |
PriorityQueue | public PriorityQueue()(Code) | | |
PriorityQueue | public PriorityQueue(int initialCapacity)(Code) | | |
PriorityQueue | public PriorityQueue(int initialCapacity, Comparator<? super E> cmp)(Code) | | |
makeHeap | protected void makeHeap(int node)(Code) | | Make the subtree rooted at node a valid heap. O(n) time
Parameters: node - |
mergeHeaps | protected void mergeHeaps(int node)(Code) | | Merge two subheaps into a single heap. O(log n) time
PRECONDITION: both children of node are heaps
Parameters: node - the parent of the two subtrees to merge |
offer | public boolean offer(E e)(Code) | | |
|
|