In cases where we need to store 10^7 or more integers what is the best method for storing and accessing these data.Vector is one of the solution but is that the fastest because when we access by index ([]) I read there are some overhead. So is there any better method?








I think it is depedent of problem,cause in some cases you dont need array for some implementations. Some cases for problems would be the "string" or "map" in c++.
It would help it you could explain the use case that you are trying to solve. 10 pow (7) roughly requires 24 bits, so you can use 3 bytes instead of 4 to save them. The problem with using vectors is that they need to be resized, amortized complexity of insertion is still constant.
definition of vector.at()
So technically once you already have a vector at() should have no overhead (except for the range check)
What are you talking about? 10^7 is the number of elements, not the limit of each elements.
O(blog(n)) sorting will be slow for n = 107 . Sorry its O(nlogn)
Memory limit is usually around 256 MB. So what's the problem?
unorderer_map — это лучше вектора _)
Array.More about it you can find here http://www.cplusplus.com/doc/tutorial/arrays/.