I am writing a removal method for a quad tree.
Now when you remove an item in a node, you will need to check its siblings to see if you need to collapse the nodes and merge them into one.
For checking the siblings, should I store a pointer to the parent node, or is there a way to do this recursively and better?
Thanks
For removal in a quadtree you'll need to basically do the following:
After step 1, you're basically done. If you want to save memory and keep the tree efficient then you should do steps 2 and 3.
And yes, you should retain a parent node reference to made reverse traversal efficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With