Esempio n. 1
0
        public MaxHeap(IEnumerable <T> items, IComparer <T> comparer)
        {
            var negatedComparer = Comparer <T> .Create((x, y) => comparer.Compare(y, x));

            minHeap = new MinHeap <T>(items, negatedComparer);
        }
Esempio n. 2
0
 public MinHeap(IEnumerable <KeyValuePair <TKey, TValue> > items, IComparer <TValue> comparer)
 {
     heap = new MinHeap <TKey, TValue, Dictionary <TKey, int> >(items, comparer);
 }