Esempio n. 1
0
 public void Enqueue(T item)
 {
     BinaryHeapEx.PushHeap(_items, item, _maxheap);
 }
Esempio n. 2
0
 public T Dequeue()
 {
     return(BinaryHeapEx.PopHeap(_items, _maxheap));
 }
Esempio n. 3
0
 public BinaryHeap(IEnumerable <T> collection, bool maxheap = true)
 {
     _items.AddRange(collection);
     _maxheap = maxheap;
     BinaryHeapEx.MakeHeap(_items, _maxheap);
 }