예제 #1
0
        public int Enqueue(object value, int priority)
        {
            var newNode = new PriorityNode(value, priority);

            Values.Add(newNode);
            return(BubbleUp(Values.Count - 1));
        }
예제 #2
0
 /// The smaller the priority value, the greater the priority.
 private bool IsGreaterPriorityThanParent(int index, PriorityNode parent) => Values[index].Priority < parent.Priority;