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