Pretty close... I'm a little leery of premature optimization, I just wanted to avoid doing something stupid.
| [reply] |

I should have said heuristics, rather than optimizations. For example, if the point of the next insertion is usually "very close" to the previous insertion, you can make a significant improvement in the performance (e.g. *O(n)* vs *O(n log n)*). At any rate, choosing a *O(n)* algorithm up front instead of a *O(n log n)* algorithm shouldn't be dismissed as "premature". It could be, in fact, a well-timed optimization of your development process. :-)
We're building the house of the future together.
| [reply] |