Looks correct. std::deque is usually implemented by storing the data in many small fixed-sized arrays instead of one big array. That can make adding elements slower because it has to allocate memory more often, but on the other hand it doesn't have to reallocate and copy elements like std::vector so it depends. Accessing elements by index will probably be a little slower using std::deque because it has to do more work doing some calculations on the index and an extra array access. The deallocation also probably slower because it has to deallocate many arrays, instead of one big array.