• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Binary tree leaf edge neighbors

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1NumberXaero  Prime Members

Posted 18 January 2014 - 12:08 PM

I have a 2d area split up using a binary tree (axial aligned, split longest edge), is there any (known) way of determining the neighbor leafs of a given leaf (rect) edge while building the tree or right after the tree is built?

In time the tree may get big, I cant really pre compute much and would like to avoid direct searches for the 4 edges of each leaf (a leaf edge may be connected to many leafs smaller than itself), which is why Id like to create this static list of leaf connections and neighbor leafs as quick as possible.

Edited by NumberXaero, 18 January 2014 - 01:03 PM.

### #2JohnnyCode  Members

Posted 23 January 2014 - 11:28 AM

If the questoin is you want to know hierarchy neighbors of a node (or leaf), you could just see its parent's childs. You say you have a binary tree, what means a node has only two childs or less. In case you do not store the information af a node's childs, but only a node parent, you will have to profile all nodes, but this is just etremely rare case of a tree aplication.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.