KeyedPriorityQueue.cs (34)
45heap.Add(default(HeapNode<K, V, P>)); // Dummy zeroth element, heap is 1-based
50V oldHead = size > 0 ? heap[1].Value : null;
53if (i == heap.Count)
54heap.Add(placeHolder);
55while (i > 1 && IsHigher(priority, heap[parent].Priority))
57heap[i] = heap[parent];
61heap[i] = new HeapNode<K, V, P>(key, value, priority);
62V newHead = heap[1].Value;
72V newHead = (size < 1) ? null : heap[1].Value;
80V oldHead = heap[1].Value;
81heap[1] = heap[size];
82heap[size--] = placeHolder;
93V oldHead = heap[1].Value;
96if (heap[i].Key.Equals(key))
98V retval = heap[i].Value;
100heap[size--] = placeHolder;
102V newHead = heap[1].Value;
115return (size < 1) ? null : heap[1].Value;
135values.Add(heap[i].Value);
148keys.Add(heap[i].Key);
156heap.Clear();
175if (IsHigher(heap[i].Priority, priority))
177if (match(heap[i].Value))
178value = heap[i].Value;
196if (left <= size && IsHigher(heap[left].Priority, heap[i].Priority))
198if (right <= size && IsHigher(heap[right].Priority, heap[highest].Priority))
212HeapNode<K, V, P> temp = heap[i];
213heap[i] = heap[j];
214heap[j] = temp;