优先队列
1 public class MyPriorityQueue<E extends Comparable>{ 2 private Heap<E> heap = new Heap<E>(); 3 4 public void enqueue(E newObject){ 5 heap.add(newObject); 6 } 7 8 public E dequeue(){ 9 return heap.remove(); 10 } 11 12 public int getSize(){ 13 return heap.getSize(); 14 } 15 }