Well I have noticed that running optimise() on a tree of half a million points seems to take twice as long (or more) than building the tree from zero. <br><br>So why run it? I was under the impression that removal of elements from a tree with erase() or erase_exact() left the tree in a undefined condition so further searches might miss points. Is that right? Or is optimise() just about performance, not correctness?<br>
<br>If that is the case, perhaps the tree could be extended so when an item is removed, the tree flags the highest node that is above everything in need of optimisation, so optimise() can search the tree only for subtrees that really need the treatment, thus saving time. <br>
<br>Just my $0.02. <br><br>Eric<br>