I'm currently working on the implementation of an algorithm that I would like to show that it can work in constant-time, even with a very large number of elements.
Unfortunately I need a data structure where to store the elements. When the number of elements is very high, but not unreasonable high for my algorithm, both std::vector and std::valarray do not access an arbitrary element in constant-time as you can see in this graph.
Is there a better data structure to store the values? Are there any techniques that I can implement to reach constant-time access?