public HeapNode PopMin() { if (Nodes.Count > 0) { HeapNode item = Nodes[0]; Nodes[0] = Nodes[Nodes.Count - 1]; Nodes.RemoveAt(Nodes.Count - 1); HeapifyDown(0); return(item); } throw new InvalidOperationException("No elements in heap!"); }
public void IncreaseSearchCount(HeapNode item, int increaseValue) { item.SearchCount += increaseValue; HeapifyDown(0); }
public void Add(HeapNode item) { Nodes.Add(item); HeapifyUp(Nodes.Count - 1); }