예제 #1
0
 public static IEnumerable <Tuple <KeyT, V> > toSeq(MinHeapPQ <V> pq)
 {
     for (; !pq.mt; pq.dltmin())
     {
         yield return(pq.pkmn);
     }
 }
예제 #2
0
        public static Tuple <Tuple <KeyT, V>, MinHeapPQ <V> > popMin(MinHeapPQ <V> pq)
        {
            var rslt = pq.pkmn; if (rslt == null)

            {
                return(null);
            }

            pq.dltmin(); return(new Tuple <Tuple <KeyT, V>, MinHeapPQ <V> >(rslt, pq));
        }
예제 #3
0
 public static MinHeapPQ <V> deleteMin(MinHeapPQ <V> pq)
 {
     pq.dltmin(); return(pq);
 }