public HeapEnumerator(MaxPriorityQueue <Key> pq) { if (pq.comparer == null) { copy = new MaxPriorityQueue <Key>(pq.Size()); } else { copy = new MaxPriorityQueue <Key>(pq.Size(), pq.comparer); } for (int i = 1; i <= pq.N; i++) { copy.Insert(pq.pq[i]); } }
public void Dispose() { copy = null; }