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