Thread history

Fragment of a discussion from User talk:Rednaxela/kD-Tree
Viewing a history listing
Jump to navigation Jump to search
Time User Activity Comment
No results

I found the error. In method RemoveOld, the loop condition of the decrementing loop should be

   cursor != null    // OK

instead of

   cursor.parent != null     // WRONG

This prevented the count in the root node of being decremented.

Whole loop (corrected):

   do {
       cursor.locationCount--;
       cursor = cursor.parent;
   } while (cursor != null);

Also RemoveOld does not adapt minLimit and maxLimit. I don't know what the impact of this would be in practice.

Ojd16:09, 7 May 2012