Re: Balanced Tree grow()

Brian Alliet <[email protected]> Sat, 10 Apr 2004 14:34:54 -0400
Newsgroups gmane.comp.java.xwt.core
Message-ID <[email protected]>
On Apr 10, 2004, at 3:16 AM, Adam Megacz wrote:

> Are we really running out of NUM_SLOTS?

Not yet.

However, because we don't implement grow we can't put any limits on the 
maximum distance a node can be from its "ideal" location. That means 
indexOf() has no way of failing if the object doesn't exist in the tree 
(it is forced to search through the tree forever).

I guess we could put some kind of limit in there and just fall back to 
a linear search through the array if we hit the limit. This would 
eliminate any non-deterministic behavior. That is pretty ugly, and 
slow, but I don't think doing an indexOf() on a non-existent node 
should happen too often.

-Brian