|
Britbot
|
|
template<T >
Definition at line 119 of file HeapPriorityQueue.cs. {
//aka Heapify-up
int parent = node.QueueIndex / 2;
while (parent >= 1)
{
T parentNode = this._nodes[parent];
if (this.HasHigherPriority(parentNode, node))
break;
//Node has lower priority value, so move it up the heap
this.Swap(node, parentNode);
//For some reason, this is faster with Swap() rather than (less..?) individual operations, like in CascadeDown()
parent = node.QueueIndex / 2;
}
}
|
1.7.6.1