예제 #1
0
 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]);
     }
 }
예제 #2
0
 public void Dispose()
 {
     copy = null;
 }