
On Wed, Oct 9, 2013 at 6:29 PM, Sergey Cheban
Also, once this data structure is completely filled I want to delete the
first data and replace it with the new data.
It's seems you need 2-dimensional sorting, one dimension for data, one for time. I have a library that is written for this kind of real-time analysis in multi-dimension, it has k-d tree containers that are self re-balancing, with insertion in fractional amortized time. You can check it out here: http://spatial.sourceforge.net/
I've been wanting to propose it for review on boost, but never got around to do it, cause I believe the documentation is sub-par. Your data set being small, 1000 (items), with a simple unsorted std::deque<> and using the std::nth_element() functor, may actually be faster. You need to try it. Good luck. Sylvain