So the standard says that a vector holds all of its elements in a continuous array of memory. Further, a std::vector will resize whenever it needs to be resized, up or down. Re-sizing and maintaining all of your memory in one continuous block means you need to maloc new memory of the new size then copy all of your data over to it -> O(n).
My understanding was that the standard solved this problem much like how hashtables solve collisions by re-sizing when a certain percent of its buckets were full. IE a vector when initialized will grab enough memory so that it can add items to the vector without having to expand to a larger array and then copy all of its data over until after enough calls it will resize yet again. Is this the case? When does the vector actually grab more memory/resize and then copy its elements over and how does it maintain the run times mentioned in Questions About Running time if it is resizing each push and erase?