Ejemplo n.º 1
0
 public void PushObj(KdQueryNode obj, float h)
 {
     Count++;
     heap[Count] = h;
     objs[Count] = obj;
     BubbleUpMin(Count);
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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);
        }