示例#1
0
 public boolean hasNext() {
   return !copy.isEmpty();
 }
示例#2
0
 public Integer next() {
   if (!hasNext()) throw new NoSuchElementException();
   return copy.delMin();
 }
示例#3
0
 public HeapIterator() {
   copy = new IndexMinPQ<Key>(pq.length - 1);
   for (int i = 1; i <= N; i++) copy.insert(pq[i], keys[pq[i]]);
 }