For a sequence of values, how would one find the sorted middle 50% of the sequence in Boost Accumulators?
For example, let's say that I have the following sequence,
25, 21, 9, 13, 17, 19, 12, 29, 50, 97, 10, 11.
The middle 50% data I would like to have is as follows:
13, 17, 19, 21.
Of course, one can sort the sequence, which now becomes
9, 10, 11, 12, 13, 17, 19, 21, 25, 29, 50, 97.
And then one can collect the middle 50% data.
Now, does the Accumulators framework internally store and sort the sequence? If yes, is it possible to retrieve the value that reside in a particular index?
Reading from here, I think the Accumulators framework does not store the original data and this framework is not appropriate for the problem I am trying to solve.
While writing this, I find it a bit foolish to try to accomplish this using Accumulators. However, I was using it for other purposes and I was expecting a solution in Accumulators.
Now, is it possible to build a data structure that efficiently maintain a current and sorted middle 50% data in a way that the size of the data structure almost never exceeds the half of the size of the sequence?
Thinking about it for a while, I guess it may not be possible to devise such a data structure. At the first thought, I thought that some of the values can be forgotten/discarded permanently assuming they will never appear in the sorted middle 50%. However, this assumption is probably wrong, and some values might reappear in the sorted middle 50% depending on the yet to arrive values in the sequence.