Hi all,
Does anyone know how to quickly (i.e. O(log n) time) insert items into a sorted list? I'd prefer an existing working function if available; I didn't see any appropriate ones in boost or stl.
Some background: I'd like to keep a constant sized sorted list, and insert items into the list while maintaining order. The item at the tail of the list is discarded after every insertion to maintain a constant size.
This is very easy to do in C# using the SortedList container class, but I need to use C++. Number of items will be a few thousand, 16 bytes of data per item.
Thanks for any leads or help!
-Doug