public static IEnumerable <Tuple <KeyT, V> > toSeq(MinHeapPQ <V> pq) { for (; !pq.mt; pq.dltmin()) { yield return(pq.pkmn); } }
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)); }
public static MinHeapPQ <V> deleteMin(MinHeapPQ <V> pq) { pq.dltmin(); return(pq); }