Beispiel #1
0
 public boolean hasNext() {
   return !copy.isEmpty();
 }
Beispiel #2
0
 public Integer next() {
   if (!hasNext()) throw new NoSuchElementException();
   return copy.delMin();
 }
Beispiel #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]]);
 }