Original Post
Hi all! I'm getting a headache trying to balance my dynamic quadtree. I want every neighbouring leaf to be at most 1 level beyond their neighbours. So only neighbours of level + 1, level - 1 and level are allowed. Otherwise i need to split the node. But splitting a node needs to recalculate the neighbours of the nodes neighbours. It's very hard to figure out this recursive stuff. So my question is, could anybody at least explain the steps neccessary to do this or have a link to a good paper or even source (C/C++, Java preferably) that explains how to find the neighbours and balance the tree? I fiddled out something but it's not robust and already took me a few ours to get it almost working. Thanks in advance, JMS