public void PushObj(KdQueryNode obj, float h) { Count++; heap[Count] = h; objs[Count] = obj; BubbleUpMin(Count); }
void Swap(int a, int b) { float tempHeap = heap[a]; KdQueryNode tempObjs = objs[a]; heap[a] = heap[b]; objs[a] = objs[b]; heap[b] = tempHeap; objs[b] = tempObjs; }
public KdQueryNode PopObj() { KdQueryNode result = objs[1]; heap[1] = heap[Count]; objs[1] = objs[Count]; objs[Count] = default; Count--; if (Count != 0) { BubbleDownMin(1); } return(result); }