public int Enqueue(object value, int priority) { var newNode = new PriorityNode(value, priority); Values.Add(newNode); return(BubbleUp(Values.Count - 1)); }
/// The smaller the priority value, the greater the priority. private bool IsGreaterPriorityThanParent(int index, PriorityNode parent) => Values[index].Priority < parent.Priority;