The push_back method seems rather clumsy in my opinion and it seems like common sense that there will be additional overhead for making the function call over and over again. I'm not certain of how the assign method will allocate the memory. According to cplusplus.com the complexity of the vector::assign operation is:
Quote:
Linear on initial and final sizes (destruction, copy construction).
In the case of the iteration version, if the iterators are forward, bidirectional or random-access, the new capacity is determined before beginning, otherwise logarithmic complexity (object reallocations) must be added on top of that.
Perhaps someone who is more knowledgeable than I could help clarify that quote.