@Override
	public Iterator<E> iterator() {
		return new Iterator<E>() {
			private PQueue<E> queue = AmortizedPQueue.this;
			public boolean hasNext() {
				return queue.size() > 0;
			}

			public E next() {
				E e = queue.peek();
				queue = queue.minus();
				return e;
			}

			public void remove() {
				throw new UnsupportedOperationException();
			}
		};
	}
@ Override public Iterator < E > iterator ( ) { return new Iterator < E > ( ) { private PQueue < E > queue = AmortizedPQueue . this ; public boolean hasNext ( ) { return queue . size ( ) > 0 ; } public E next ( ) { E e = queue . peek ( ) ; queue = queue . minus ( ) ; return e ; } public void remove ( ) { throw new UnsupportedOperationException ( ) ; } } ; }
/* Worst-case O(n)